public abstract class AbstractPreAndPostProcessingAuthenticationHandler extends AbstractAuthenticationHandler implements PrePostAuthenticationHandler
credentialSelectionPredicate, principalFactory, servicesManager
SUCCESSFUL_AUTHENTICATION_HANDLERS
Constructor and Description |
---|
AbstractPreAndPostProcessingAuthenticationHandler(java.lang.String name,
ServicesManager servicesManager,
PrincipalFactory principalFactory,
java.lang.Integer order) |
Modifier and Type | Method and Description |
---|---|
AuthenticationHandlerExecutionResult |
authenticate(Credential credential)
Authenticates the given credential.
|
protected AuthenticationHandlerExecutionResult |
createHandlerResult(Credential credential,
Principal principal)
Helper method to construct a handler result
on successful authentication events.
|
protected AuthenticationHandlerExecutionResult |
createHandlerResult(Credential credential,
Principal principal,
java.util.List<MessageDescriptor> warnings)
Helper method to construct a handler result
on successful authentication events.
|
protected abstract AuthenticationHandlerExecutionResult |
doAuthentication(Credential credential)
Performs the details of authentication and returns an authentication handler result on success.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
postAuthenticate, preAuthenticate
getName, getOrder, supports
public AbstractPreAndPostProcessingAuthenticationHandler(java.lang.String name, ServicesManager servicesManager, PrincipalFactory principalFactory, java.lang.Integer order)
public AuthenticationHandlerExecutionResult authenticate(Credential credential) throws java.security.GeneralSecurityException, PreventedException
AuthenticationHandler
AuthenticationHandlerExecutionResult
GeneralSecurityException
PreventedException
authenticate
in interface AuthenticationHandler
credential
- The credential to authenticate.Principal
java.security.GeneralSecurityException
- On authentication failures where the root cause is security related,
e.g. invalid credential. Implementing classes SHOULD be as specific as possible in communicating the reason for
authentication failure. Recommendations for common cases:
javax.security.auth.login.FailedLoginException
javax.security.auth.login.CredentialExpiredException
javax.security.auth.login.AccountExpiredException
javax.security.auth.login.AccountLockedException
javax.security.auth.login.AccountNotFoundException
org.apereo.cas.authentication.InvalidLoginTimeException
org.apereo.cas.authentication.InvalidLoginLocationException
java.security.cert.CertificateExpiredException
PreventedException
- On errors that prevented authentication from occurring. Implementing classes SHOULD
take care to populate the cause, where applicable, with the error that prevented authentication.protected abstract AuthenticationHandlerExecutionResult doAuthentication(Credential credential) throws java.security.GeneralSecurityException, PreventedException
credential
- Credential to authenticate.java.security.GeneralSecurityException
- On authentication failure that is thrown out to the caller of
authenticate(Credential)
.PreventedException
- On the indeterminate case when authentication is prevented.protected AuthenticationHandlerExecutionResult createHandlerResult(@NonNull Credential credential, @NonNull Principal principal, java.util.List<MessageDescriptor> 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 warningsprotected AuthenticationHandlerExecutionResult createHandlerResult(@NonNull Credential credential, @NonNull Principal principal)
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 principal