Package org.apereo.cas.adaptors.generic
Class FileAuthenticationHandler
- 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.adaptors.generic.FileAuthenticationHandler
-
- All Implemented Interfaces:
org.apereo.cas.authentication.AuthenticationHandler,org.apereo.cas.authentication.PrePostAuthenticationHandler,org.springframework.core.Ordered
public class FileAuthenticationHandler extends org.apereo.cas.authentication.handler.support.AbstractUsernamePasswordAuthenticationHandlerClass designed to read data from a file in the format of USERNAME SEPARATOR PASSWORD that will go line by line and look for the username. If it finds the username it will compare the supplied password (first put through a PasswordTranslator) that is compared to the password provided in the file. If there is a match, the user is authenticated. Note that the default password translator is a plaintext password translator and the default separator is "::" (without quotes).- Since:
- 3.0.0
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDEFAULT_SEPARATORThe default separator in the file.-
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 FileAuthenticationHandler(java.lang.String name, org.apereo.cas.services.ServicesManager servicesManager, org.apereo.cas.authentication.principal.PrincipalFactory principalFactory, org.springframework.core.io.Resource fileName, java.lang.String separator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.apereo.cas.authentication.AuthenticationHandlerExecutionResultauthenticateUsernamePasswordInternal(org.apereo.cas.authentication.credential.UsernamePasswordCredential transformedCredential, java.lang.String originalPassword)-
Methods inherited from class org.apereo.cas.authentication.handler.support.AbstractUsernamePasswordAuthenticationHandler
doAuthentication, getPasswordEncoder, getPasswordPolicyConfiguration, getPasswordPolicyHandlingStrategy, getPrincipalNameTransformer, matches, setPasswordEncoder, setPasswordPolicyConfiguration, setPasswordPolicyHandlingStrategy, setPrincipalNameTransformer, supports, supports, transformPassword, transformUsername
-
Methods inherited from class org.apereo.cas.authentication.handler.support.AbstractPreAndPostProcessingAuthenticationHandler
authenticate, createHandlerResult, createHandlerResult
-
Methods inherited from class org.apereo.cas.authentication.AbstractAuthenticationHandler
canEqual, equals, getCredentialSelectionPredicate, getName, getOrder, getPrincipalFactory, getServicesManager, getState, hashCode, setCredentialSelectionPredicate, setState
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Field Detail
-
DEFAULT_SEPARATOR
public static final java.lang.String DEFAULT_SEPARATOR
The default separator in the file.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FileAuthenticationHandler
public FileAuthenticationHandler(java.lang.String name, org.apereo.cas.services.ServicesManager servicesManager, org.apereo.cas.authentication.principal.PrincipalFactory principalFactory, org.springframework.core.io.Resource fileName, java.lang.String separator)
-
-
Method Detail
-
authenticateUsernamePasswordInternal
protected org.apereo.cas.authentication.AuthenticationHandlerExecutionResult authenticateUsernamePasswordInternal(org.apereo.cas.authentication.credential.UsernamePasswordCredential transformedCredential, java.lang.String originalPassword) throws java.security.GeneralSecurityException, org.apereo.cas.authentication.PreventedException- Specified by:
authenticateUsernamePasswordInternalin classorg.apereo.cas.authentication.handler.support.AbstractUsernamePasswordAuthenticationHandler- Throws:
java.security.GeneralSecurityExceptionorg.apereo.cas.authentication.PreventedException
-
-