public abstract class AbstractUsernamePasswordAuthenticationHandler extends AbstractPreAndPostProcessingAuthenticationHandler
logger| Constructor and Description |
|---|
AbstractUsernamePasswordAuthenticationHandler() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract HandlerResult |
authenticateUsernamePasswordInternal(UsernamePasswordCredential transformedCredential)
Authenticates a username/password credential by an arbitrary strategy.
|
protected HandlerResult |
createHandlerResult(Credential credential,
Principal principal,
List<Message> warnings)
Helper method to construct a handler result
on successful authentication events.
|
protected HandlerResult |
doAuthentication(Credential credential)
Performs the details of authentication and returns an authentication handler result on success.
|
protected PasswordEncoder |
getPasswordEncoder()
Method to return the PasswordEncoder to be used to encode passwords.
|
protected PasswordPolicyConfiguration |
getPasswordPolicyConfiguration() |
protected PrincipalNameTransformer |
getPrincipalNameTransformer() |
void |
setPasswordEncoder(PasswordEncoder passwordEncoder)
Sets the PasswordEncoder to be used with this class.
|
void |
setPasswordPolicyConfiguration(PasswordPolicyConfiguration passwordPolicyConfiguration) |
void |
setPrincipalNameTransformer(PrincipalNameTransformer principalNameTransformer) |
boolean |
supports(Credential credential)
Determines whether the handler has the capability to authenticate the given credential.
|
authenticate, postAuthenticate, preAuthenticategetName, setNamepublic AbstractUsernamePasswordAuthenticationHandler()
protected final HandlerResult doAuthentication(Credential credential) throws GeneralSecurityException, PreventedException
doAuthentication in class AbstractPreAndPostProcessingAuthenticationHandlercredential - Credential to authenticate.GeneralSecurityException - On authentication failure that is thrown out to the caller of
AbstractPreAndPostProcessingAuthenticationHandler.authenticate(org.jasig.cas.authentication.Credential).PreventedException - On the indeterminate case when authentication is prevented.protected abstract HandlerResult authenticateUsernamePasswordInternal(UsernamePasswordCredential transformedCredential) throws GeneralSecurityException, PreventedException
transformedCredential - the credential object bearing the transformed username and password.GeneralSecurityException - On authentication failure.PreventedException - On the indeterminate case when authentication is prevented.protected final PasswordEncoder getPasswordEncoder()
protected final PrincipalNameTransformer getPrincipalNameTransformer()
protected final PasswordPolicyConfiguration getPasswordPolicyConfiguration()
protected final HandlerResult createHandlerResult(Credential credential, Principal principal, List<Message> warnings)
credential - the credential on which the authentication was successfully performed.
Note that this credential instance may be different from what was originally provided
as transformation of the username may have occurred, if one is in fact defined.principal - the resolved principalwarnings - the warningspublic final void setPasswordEncoder(PasswordEncoder passwordEncoder)
passwordEncoder - the PasswordEncoder to use when encoding
passwords.public final void setPrincipalNameTransformer(PrincipalNameTransformer principalNameTransformer)
public final void setPasswordPolicyConfiguration(PasswordPolicyConfiguration passwordPolicyConfiguration)
public boolean supports(Credential credential)
AuthenticationHandlerAuthenticationHandler.authenticate(Credential) method MUST be capable of processing a given credential if
supports returns true on the same credential.credential - The credential to check.UsernamePasswordCredential, false otherwise.Copyright © 2004-2015 Apereo. All Rights Reserved.