org.jasig.cas.adaptors.generic
Class RejectUsersAuthenticationHandler

java.lang.Object
  extended by org.jasig.cas.authentication.handler.support.AbstractPreAndPostProcessingAuthenticationHandler
      extended by org.jasig.cas.authentication.handler.support.AbstractUsernamePasswordAuthenticationHandler
          extended by org.jasig.cas.adaptors.generic.RejectUsersAuthenticationHandler
All Implemented Interfaces:
AuthenticationHandler, NamedAuthenticationHandler

public class RejectUsersAuthenticationHandler
extends AbstractUsernamePasswordAuthenticationHandler

AuthenticationHandler which fails to authenticate a user purporting to be one of the blocked usernames, and blindly authenticates all other users.

Note that RejectUsersAuthenticationHandler throws an exception when the user is found in the map. This is done to indicate that this is an extreme case and any AuthenticationManager checking the RejectUsersAuthenticationHandler should not continue checking other Authentication Handlers on the failure of RejectUsersAuthenticationHandler to authenticate someone.

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

Field Summary
 
Fields inherited from class org.jasig.cas.authentication.handler.support.AbstractPreAndPostProcessingAuthenticationHandler
log
 
Constructor Summary
RejectUsersAuthenticationHandler()
           
 
Method Summary
protected  boolean authenticateUsernamePasswordInternal(UsernamePasswordCredentials credentials)
           
 void setUsers(java.util.List<java.lang.String> users)
          Set the Collection of usernames which we will fail to authenticate.
 
Methods inherited from class org.jasig.cas.authentication.handler.support.AbstractUsernamePasswordAuthenticationHandler
doAuthentication, getPasswordEncoder, getPrincipalNameTransformer, setClassToSupport, setPasswordEncoder, setPrincipalNameTransformer, setSupportSubClasses, supports
 
Methods inherited from class org.jasig.cas.authentication.handler.support.AbstractPreAndPostProcessingAuthenticationHandler
authenticate, getName, postAuthenticate, preAuthenticate, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RejectUsersAuthenticationHandler

public RejectUsersAuthenticationHandler()
Method Detail

authenticateUsernamePasswordInternal

protected final boolean authenticateUsernamePasswordInternal(UsernamePasswordCredentials credentials)
                                                      throws AuthenticationException
Specified by:
authenticateUsernamePasswordInternal in class AbstractUsernamePasswordAuthenticationHandler
Throws:
AuthenticationException

setUsers

public final void setUsers(java.util.List<java.lang.String> users)
Set the Collection of usernames which we will fail to authenticate.

Parameters:
users - The Collection of usernames we should not authenticate.


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