org.jasig.cas.authentication
Class AuthenticationManagerImpl

java.lang.Object
  extended by org.jasig.cas.authentication.AuthenticationManagerImpl
All Implemented Interfaces:
AuthenticationManager

public final class AuthenticationManagerImpl
extends java.lang.Object
implements AuthenticationManager

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:

Since:
3.0
Version:
$Revision: 43394 $ $Date: 2008-03-19 08:36:13 -0400 (Wed, 19 Mar 2008) $
Author:
Scott Battaglia
See Also:
AuthenticationHandler, CredentialsToPrincipalResolver, AuthenticationMetaDataPopulator

Field Summary
 
Fields inherited from interface org.jasig.cas.authentication.AuthenticationManager
AUTHENTICATION_METHOD_ATTRIBUTE
 
Constructor Summary
AuthenticationManagerImpl()
           
 
Method Summary
 Authentication authenticate(Credentials credentials)
          Method to validate the credentials provided.
 void setAuthenticationHandlers(java.util.List<AuthenticationHandler> authenticationHandlers)
           
 void setAuthenticationMetaDataPopulators(java.util.List<AuthenticationMetaDataPopulator> authenticationMetaDataPopulators)
           
 void setCredentialsToPrincipalResolvers(java.util.List<CredentialsToPrincipalResolver> credentialsToPrincipalResolvers)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuthenticationManagerImpl

public AuthenticationManagerImpl()
Method Detail

authenticate

public Authentication authenticate(Credentials credentials)
                            throws AuthenticationException
Description copied from interface: AuthenticationManager
Method to validate the credentials provided. On successful validation, a fully populated Authentication object will be returned. Typically this will involve resolving a principal and providing any additional attributes, but specifics are left to the individual implementations to determine. Failure to authenticate is considered an exceptional case, and an AuthenticationException is thrown.

Specified by:
authenticate in interface AuthenticationManager
Parameters:
credentials - The credentials provided for authentication.
Returns:
fully populated Authentication object.
Throws:
AuthenticationException - if unable to determine validity of credentials or there is an extenuating circumstance related to credentials (i.e. Account locked).

setAuthenticationHandlers

public void setAuthenticationHandlers(java.util.List<AuthenticationHandler> authenticationHandlers)
Parameters:
authenticationHandlers - The authenticationHandlers to set.

setCredentialsToPrincipalResolvers

public void setCredentialsToPrincipalResolvers(java.util.List<CredentialsToPrincipalResolver> credentialsToPrincipalResolvers)
Parameters:
credentialsToPrincipalResolvers - The credentialsToPrincipalResolvers to set.

setAuthenticationMetaDataPopulators

public void setAuthenticationMetaDataPopulators(java.util.List<AuthenticationMetaDataPopulator> authenticationMetaDataPopulators)
Parameters:
authenticationMetaDataPopulators - the authenticationMetaDataPopulators to set.


Copyright © 2004-2009 Java Architectures Special Interest Group. All Rights Reserved.