org.jasig.cas.authentication
Class AuthenticationManagerImpl

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

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:

Since:
3.0
Version:
$Revision: 47522 $ $Date: 2009-12-14 23:33:36 -0500 (Mon, 14 Dec 2009) $
Author:
Scott Battaglia
See Also:
AuthenticationHandler, CredentialsToPrincipalResolver, AuthenticationMetaDataPopulator

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jasig.cas.authentication.AbstractAuthenticationManager
AbstractAuthenticationManager.Pair<A,B>
 
Field Summary
 
Fields inherited from class org.jasig.cas.authentication.AbstractAuthenticationManager
log
 
Fields inherited from interface org.jasig.cas.authentication.AuthenticationManager
AUTHENTICATION_METHOD_ATTRIBUTE
 
Constructor Summary
AuthenticationManagerImpl()
           
 
Method Summary
protected  AbstractAuthenticationManager.Pair<AuthenticationHandler,Principal> authenticateAndObtainPrincipal(Credentials credentials)
          Follows the same rules as the "authenticate" method (i.e.
 void setAuthenticationHandlers(java.util.List<AuthenticationHandler> authenticationHandlers)
           
 void setCredentialsToPrincipalResolvers(java.util.List<CredentialsToPrincipalResolver> credentialsToPrincipalResolvers)
           
 
Methods inherited from class org.jasig.cas.authentication.AbstractAuthenticationManager
authenticate, setAuthenticationMetaDataPopulators
 
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

authenticateAndObtainPrincipal

protected AbstractAuthenticationManager.Pair<AuthenticationHandler,Principal> authenticateAndObtainPrincipal(Credentials credentials)
                                                                                                      throws AuthenticationException
Description copied from class: AbstractAuthenticationManager
Follows the same rules as the "authenticate" method (i.e. should only return a fully populated object, or throw an exception)

Specified by:
authenticateAndObtainPrincipal in class AbstractAuthenticationManager
Parameters:
credentials - the credentials to check
Returns:
the pair of authentication handler and principal. CANNOT be NULL.
Throws:
AuthenticationException - if there is an error authenticating.

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.


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