public class PreAuthenticatedAuthenticationProvider extends Object implements org.springframework.security.authentication.AuthenticationProvider, InitializingBean, Ordered
Processes a pre-authenticated authentication request. The request will
typically originate from a AbstractPreAuthenticatedProcessingFilter
subclass.
This authentication provider will not perform any checks on authentication requests, as they should already be pre-authenticated. However, the AuthenticationUserDetailsService implementation may still throw a UsernameNotFoundException, for example.
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor and Description |
---|
PreAuthenticatedAuthenticationProvider() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet()
Check whether all required properties have been set.
|
org.springframework.security.core.Authentication |
authenticate(org.springframework.security.core.Authentication authentication)
Authenticate the given PreAuthenticatedAuthenticationToken.
|
int |
getOrder() |
void |
setOrder(int i) |
void |
setPreAuthenticatedUserDetailsService(org.springframework.security.core.userdetails.AuthenticationUserDetailsService<PreAuthenticatedAuthenticationToken> uds)
Set the AuthenticatedUserDetailsService to be used to load the
UserDetails for the authenticated user. |
void |
setThrowExceptionWhenTokenRejected(boolean throwExceptionWhenTokenRejected)
If true, causes the provider to throw a BadCredentialsException if the presented authentication
request is invalid (contains a null principal or credentials).
|
void |
setUserDetailsChecker(org.springframework.security.core.userdetails.UserDetailsChecker userDetailsChecker)
Sets the strategy which will be used to validate the loaded UserDetails object
for the user.
|
boolean |
supports(Class<?> authentication)
Indicate that this provider only supports PreAuthenticatedAuthenticationToken (sub)classes.
|
public PreAuthenticatedAuthenticationProvider()
public void afterPropertiesSet()
afterPropertiesSet
in interface InitializingBean
public org.springframework.security.core.Authentication authenticate(org.springframework.security.core.Authentication authentication) throws org.springframework.security.core.AuthenticationException
If the principal contained in the authentication object is null, the request will be ignored to allow other providers to authenticate it.
authenticate
in interface org.springframework.security.authentication.AuthenticationProvider
org.springframework.security.core.AuthenticationException
public final boolean supports(Class<?> authentication)
supports
in interface org.springframework.security.authentication.AuthenticationProvider
public void setPreAuthenticatedUserDetailsService(org.springframework.security.core.userdetails.AuthenticationUserDetailsService<PreAuthenticatedAuthenticationToken> uds)
UserDetails
for the authenticated user.uds
- public void setThrowExceptionWhenTokenRejected(boolean throwExceptionWhenTokenRejected)
public void setUserDetailsChecker(org.springframework.security.core.userdetails.UserDetailsChecker userDetailsChecker)
AccountStatusUserDetailsChecker
.userDetailsChecker
- public void setOrder(int i)