Package org.apereo.cas.authentication
Class AcceptUsersAuthenticationHandler
- java.lang.Object
-
- org.apereo.cas.authentication.AbstractAuthenticationHandler
-
- org.apereo.cas.authentication.handler.support.AbstractPreAndPostProcessingAuthenticationHandler
-
- org.apereo.cas.authentication.handler.support.AbstractUsernamePasswordAuthenticationHandler
-
- org.apereo.cas.authentication.AcceptUsersAuthenticationHandler
-
- All Implemented Interfaces:
org.apereo.cas.authentication.AuthenticationHandler,org.apereo.cas.authentication.PrePostAuthenticationHandler,org.springframework.core.Ordered
public class AcceptUsersAuthenticationHandler extends AbstractUsernamePasswordAuthenticationHandler
Handler that contains a list of valid users and passwords. Useful if there is a small list of users that we wish to allow. An example use case may be if there are existing handlers that make calls to LDAP, etc. but there is a need for additional users we don't want in LDAP. With the chain of command processing of handlers, this handler could be added to check before LDAP and provide the list of additional users. The list of acceptable users is stored in a map. The key of the map is the username and the password is the object retrieved from doing map.get(KEY).- Since:
- 3.0.0
-
-
Field Summary
-
Fields inherited from class org.apereo.cas.authentication.handler.support.AbstractUsernamePasswordAuthenticationHandler
passwordPolicyHandlingStrategy
-
Fields inherited from class org.apereo.cas.authentication.AbstractAuthenticationHandler
principalFactory
-
-
Constructor Summary
Constructors Constructor Description AcceptUsersAuthenticationHandler(java.lang.String name)AcceptUsersAuthenticationHandler(java.lang.String name, org.apereo.cas.services.ServicesManager servicesManager, org.apereo.cas.authentication.principal.PrincipalFactory principalFactory, java.lang.Integer order, java.util.Map<java.lang.String,java.lang.String> users)AcceptUsersAuthenticationHandler(java.util.Map<java.lang.String,java.lang.String> users)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.apereo.cas.authentication.AuthenticationHandlerExecutionResultauthenticateUsernamePasswordInternal(UsernamePasswordCredential credential, java.lang.String originalPassword)Authenticates a username/password credential by an arbitrary strategy with extra parameter original credential password before encoding password.-
Methods inherited from class org.apereo.cas.authentication.handler.support.AbstractUsernamePasswordAuthenticationHandler
doAuthentication, matches, supports, supports, transformPassword, transformUsername
-
Methods inherited from class org.apereo.cas.authentication.handler.support.AbstractPreAndPostProcessingAuthenticationHandler
authenticate, createHandlerResult, createHandlerResult
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Constructor Detail
-
AcceptUsersAuthenticationHandler
public AcceptUsersAuthenticationHandler(java.util.Map<java.lang.String,java.lang.String> users)
-
AcceptUsersAuthenticationHandler
public AcceptUsersAuthenticationHandler(java.lang.String name)
-
AcceptUsersAuthenticationHandler
public AcceptUsersAuthenticationHandler(java.lang.String name, org.apereo.cas.services.ServicesManager servicesManager, org.apereo.cas.authentication.principal.PrincipalFactory principalFactory, java.lang.Integer order, java.util.Map<java.lang.String,java.lang.String> users)
-
-
Method Detail
-
authenticateUsernamePasswordInternal
protected org.apereo.cas.authentication.AuthenticationHandlerExecutionResult authenticateUsernamePasswordInternal(UsernamePasswordCredential credential, java.lang.String originalPassword) throws java.security.GeneralSecurityException
Description copied from class:AbstractUsernamePasswordAuthenticationHandlerAuthenticates a username/password credential by an arbitrary strategy with extra parameter original credential password before encoding password. Override it if implementation need to use original password for authentication.- Specified by:
authenticateUsernamePasswordInternalin classAbstractUsernamePasswordAuthenticationHandler- Parameters:
credential- the credential object bearing the transformed username and password.originalPassword- original password from credential before password encoding- Returns:
- AuthenticationHandlerExecutionResult resolved from credential on authentication success or null if no principal could be resolved from the credential.
- Throws:
java.security.GeneralSecurityException- On authentication failure.
-
-