Class PreAuthenticatedAuthenticationProvider
java.lang.Object
org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationProvider
- All Implemented Interfaces:
- org.springframework.beans.factory.InitializingBean,- org.springframework.core.Ordered,- AuthenticationProvider
public class PreAuthenticatedAuthenticationProvider
extends Object
implements AuthenticationProvider, org.springframework.beans.factory.InitializingBean, org.springframework.core.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.
- Since:
- 2.0
- 
Field SummaryFields inherited from interface org.springframework.core.OrderedHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidCheck whether all required properties have been set.authenticate(Authentication authentication) Authenticate the given PreAuthenticatedAuthenticationToken.intgetOrder()voidsetOrder(int i) voidsetPreAuthenticatedUserDetailsService(AuthenticationUserDetailsService<PreAuthenticatedAuthenticationToken> uds) Set the AuthenticatedUserDetailsService to be used to load theUserDetailsfor the authenticated user.voidsetThrowExceptionWhenTokenRejected(boolean throwExceptionWhenTokenRejected) If true, causes the provider to throw a BadCredentialsException if the presented authentication request is invalid (contains a null principal or credentials).voidsetUserDetailsChecker(UserDetailsChecker userDetailsChecker) Sets the strategy which will be used to validate the loaded UserDetails object for the user.final booleanIndicate that this provider only supports PreAuthenticatedAuthenticationToken (sub)classes.
- 
Constructor Details- 
PreAuthenticatedAuthenticationProviderpublic PreAuthenticatedAuthenticationProvider()
 
- 
- 
Method Details- 
afterPropertiesSetpublic void afterPropertiesSet()Check whether all required properties have been set.- Specified by:
- afterPropertiesSetin interface- org.springframework.beans.factory.InitializingBean
 
- 
authenticateAuthenticate the given PreAuthenticatedAuthenticationToken.If the principal contained in the authentication object is null, the request will be ignored to allow other providers to authenticate it. - Specified by:
- authenticatein interface- AuthenticationProvider
- Parameters:
- authentication- the authentication request object.
- Returns:
- a fully authenticated object including credentials. May return
 nullif theAuthenticationProvideris unable to support authentication of the passedAuthenticationobject. In such a case, the nextAuthenticationProviderthat supports the presentedAuthenticationclass will be tried.
- Throws:
- AuthenticationException- if authentication fails.
 
- 
supportsIndicate that this provider only supports PreAuthenticatedAuthenticationToken (sub)classes.- Specified by:
- supportsin interface- AuthenticationProvider
- Returns:
- trueif the implementation can more closely evaluate the- Authenticationclass presented
 
- 
setPreAuthenticatedUserDetailsServicepublic void setPreAuthenticatedUserDetailsService(AuthenticationUserDetailsService<PreAuthenticatedAuthenticationToken> uds) Set the AuthenticatedUserDetailsService to be used to load theUserDetailsfor the authenticated user.- Parameters:
- uds-
 
- 
setThrowExceptionWhenTokenRejectedpublic 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). Otherwise it will just return null. Defaults to false.
- 
setUserDetailsCheckerSets the strategy which will be used to validate the loaded UserDetails object for the user. Defaults to anAccountStatusUserDetailsChecker.- Parameters:
- userDetailsChecker-
 
- 
getOrderpublic int getOrder()- Specified by:
- getOrderin interface- org.springframework.core.Ordered
 
- 
setOrderpublic void setOrder(int i) 
 
-