JSecurity

org.jsecurity.authc.pam
Class AtLeastOneSuccessfulModularAuthenticationStrategy

java.lang.Object
  extended by org.jsecurity.authc.pam.AbstractAuthenticationStrategy
      extended by org.jsecurity.authc.pam.AtLeastOneSuccessfulModularAuthenticationStrategy
All Implemented Interfaces:
ModularAuthenticationStrategy

public class AtLeastOneSuccessfulModularAuthenticationStrategy
extends AbstractAuthenticationStrategy

ModularAuthenticationStrategy implementation that requires at least one configured realm to successfully process the submitted AuthenticationToken during the log-in attempt.

This means any number of configured realms do not have to support the submitted log-in token, or they may be unable to acquire AuthenticationInfo for the token, but as long as at least one can do both, this Strategy implementation will allow the log-in process to be successful.

Note that this implementation will aggregate the account data from all successfully consulted realms during the authentication attempt. If you want only the account data from the first successfully consulted realm and want to ignore all subsequent realms, use the FirstSuccessfulAuthenticationStrategy instead.

Since:
0.2
Author:
Les Hazlewood
See Also:
FirstSuccessfulAuthenticationStrategy

Constructor Summary
AtLeastOneSuccessfulModularAuthenticationStrategy()
           
 
Method Summary
 AuthenticationInfo afterAllAttempts(AuthenticationToken token, AuthenticationInfo aggregate)
          Method invoked by the ModularAuthenticator signifying that all of its configured Realms have been consulted for account data, allowing post-proccessing after all realms have completed.
 
Methods inherited from class org.jsecurity.authc.pam.AbstractAuthenticationStrategy
afterAttempt, beforeAllAttempts, beforeAttempt, merge
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AtLeastOneSuccessfulModularAuthenticationStrategy

public AtLeastOneSuccessfulModularAuthenticationStrategy()
Method Detail

afterAllAttempts

public AuthenticationInfo afterAllAttempts(AuthenticationToken token,
                                           AuthenticationInfo aggregate)
                                    throws AuthenticationException
Description copied from interface: ModularAuthenticationStrategy
Method invoked by the ModularAuthenticator signifying that all of its configured Realms have been consulted for account data, allowing post-proccessing after all realms have completed.

Returns the final AuthenticationInfo object that will be returned from the Authenticator to the authenticate() caller. This is most likely the aggregate AuthenticationInfo object that has been populated by many realms, but the actual return value is always up to the implementation.

Specified by:
afterAllAttempts in interface ModularAuthenticationStrategy
Overrides:
afterAllAttempts in class AbstractAuthenticationStrategy
Parameters:
token - the AuthenticationToken submitted for the subject attempting system log-in.
aggregate - the aggregate AuthenticationInfo instance populated by all realms during the log-in attempt.
Returns:
the final AuthenticationInfo object to return to the Authenticator.authenticate() caller.
Throws:
AuthenticationException - if the Strategy implementation wishes to fail the authentication attempt.

JSecurity

Copyright © 2004-2008 JSecurity.