public final class AuthenticationManagerImpl extends AbstractAuthenticationManager
Default implementation of the AuthenticationManager. The AuthenticationManager follows the following algorithm. The manager loops through the array of AuthenticationHandlers searching for one that can attempt to determine the validity of the credentials. If it finds one, it tries that one. If that handler returns true, it continues on. If it returns false, it looks for another handler. If it throws an exception, it aborts the whole process and rethrows the exception. Next, it looks for a CredentialsToPrincipalResolver that can handle the credentials in order to create a Principal. Finally, it attempts to populate the Authentication object's attributes map using AuthenticationAttributesPopulators
Behavior is determined by external beans attached through three configuration properties. The Credentials are opaque to the manager. They are passed to the external beans to see if any can process the actual type represented by the Credentials marker.
AuthenticationManagerImpl requires the following properties to be set:
authenticationHandlers - The array of
AuthenticationHandlers that know how to process the credentials provided.
credentialsToPrincipalResolvers - The array of
CredentialsToPrincipal resolvers that know how to process the credentials
provided.
AuthenticationHandler,
CredentialsToPrincipalResolver,
AuthenticationMetaDataPopulatorAbstractAuthenticationManager.Pair<A,B>logAUTHENTICATION_METHOD_ATTRIBUTE| Constructor and Description |
|---|
AuthenticationManagerImpl() |
| Modifier and Type | Method and Description |
|---|---|
protected AbstractAuthenticationManager.Pair<AuthenticationHandler,Principal> |
authenticateAndObtainPrincipal(Credentials credentials)
Follows the same rules as the "authenticate" method (i.e.
|
void |
setAuthenticationHandlers(List<AuthenticationHandler> authenticationHandlers) |
void |
setCredentialsToPrincipalResolvers(List<CredentialsToPrincipalResolver> credentialsToPrincipalResolvers) |
authenticate, logAuthenticationHandlerError, setAuthenticationMetaDataPopulatorsprotected AbstractAuthenticationManager.Pair<AuthenticationHandler,Principal> authenticateAndObtainPrincipal(Credentials credentials) throws AuthenticationException
AbstractAuthenticationManagerauthenticateAndObtainPrincipal in class AbstractAuthenticationManagercredentials - the credentials to checkAuthenticationException - if there is an error authenticating.public void setAuthenticationHandlers(List<AuthenticationHandler> authenticationHandlers)
authenticationHandlers - The authenticationHandlers to set.public void setCredentialsToPrincipalResolvers(List<CredentialsToPrincipalResolver> credentialsToPrincipalResolvers)
credentialsToPrincipalResolvers - The
credentialsToPrincipalResolvers to set.Copyright © 2004-2012 Jasig. All Rights Reserved.