org.springframework.security.authentication
Class AbstractAuthenticationManager

java.lang.Object
  extended by org.springframework.security.authentication.AbstractAuthenticationManager
All Implemented Interfaces:
AuthenticationManager
Direct Known Subclasses:
ProviderManager

public abstract class AbstractAuthenticationManager
extends Object
implements AuthenticationManager

An abstract implementation of the AuthenticationManager.

Version:
$Id: AbstractAuthenticationManager.java 3550 2009-04-13 13:43:23Z ltaylor $
Author:
Wesley Hall

Constructor Summary
AbstractAuthenticationManager()
           
 
Method Summary
 Authentication authenticate(Authentication authRequest)
          An implementation of the authenticate method that calls the abstract method doAuthenticatation to do its work.
protected abstract  Authentication doAuthentication(Authentication authentication)
          Concrete implementations of this class override this method to provide the authentication service.
 void setClearExtraInformation(boolean clearExtraInformation)
          If set to true, the extraInformation set on an AuthenticationException will be cleared before rethrowing it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractAuthenticationManager

public AbstractAuthenticationManager()
Method Detail

authenticate

public final Authentication authenticate(Authentication authRequest)
                                  throws AuthenticationException
An implementation of the authenticate method that calls the abstract method doAuthenticatation to do its work.

If doAuthenticate throws an AuthenticationException then the exception is populated with the failed Authentication object that failed.

Specified by:
authenticate in interface AuthenticationManager
Parameters:
authRequest - the authentication request object
Returns:
a fully authenticated object including credentials
Throws:
AuthenticationException - if authentication fails

doAuthentication

protected abstract Authentication doAuthentication(Authentication authentication)
                                            throws AuthenticationException
Concrete implementations of this class override this method to provide the authentication service.

The contract for this method is documented in the AuthenticationManager.authenticate(Authentication).

Parameters:
authentication - the authentication request object
Returns:
a fully authenticated object including credentials
Throws:
AuthenticationException - if authentication fails

setClearExtraInformation

public void setClearExtraInformation(boolean clearExtraInformation)
If set to true, the extraInformation set on an AuthenticationException will be cleared before rethrowing it. This is useful for use with remoting protocols where the information shouldn't be serialized to the client. Defaults to 'false'.

See Also:
AuthenticationException.getExtraInformation()


Copyright © 2004-2009 SpringSource, Inc. All Rights Reserved.