Class AbstractPreAndPostProcessingAuthenticationHandler
- java.lang.Object
-
- org.apereo.cas.authentication.AbstractAuthenticationHandler
-
- org.apereo.cas.authentication.handler.support.AbstractPreAndPostProcessingAuthenticationHandler
-
- All Implemented Interfaces:
org.apereo.cas.authentication.AuthenticationHandler,org.apereo.cas.authentication.PrePostAuthenticationHandler,org.springframework.core.Ordered
- Direct Known Subclasses:
AbstractUsernamePasswordAuthenticationHandler
public abstract class AbstractPreAndPostProcessingAuthenticationHandler extends AbstractAuthenticationHandler implements org.apereo.cas.authentication.PrePostAuthenticationHandler
Abstract authentication handler that allows deployers to utilize the bundled AuthenticationHandlers while providing a mechanism to perform tasks before and after authentication.- Since:
- 3.1
-
-
Field Summary
-
Fields inherited from class org.apereo.cas.authentication.AbstractAuthenticationHandler
credentialSelectionPredicate, principalFactory, servicesManager
-
-
Constructor Summary
Constructors Constructor Description AbstractPreAndPostProcessingAuthenticationHandler(java.lang.String name, org.apereo.cas.services.ServicesManager servicesManager, org.apereo.cas.authentication.principal.PrincipalFactory principalFactory, java.lang.Integer order)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description org.apereo.cas.authentication.AuthenticationHandlerExecutionResultauthenticate(org.apereo.cas.authentication.Credential credential)protected org.apereo.cas.authentication.AuthenticationHandlerExecutionResultcreateHandlerResult(org.apereo.cas.authentication.Credential credential, org.apereo.cas.authentication.principal.Principal principal)Helper method to construct a handler result on successful authentication events.protected org.apereo.cas.authentication.AuthenticationHandlerExecutionResultcreateHandlerResult(org.apereo.cas.authentication.Credential credential, org.apereo.cas.authentication.principal.Principal principal, java.util.List<org.apereo.cas.authentication.MessageDescriptor> warnings)Helper method to construct a handler result on successful authentication events.protected abstract org.apereo.cas.authentication.AuthenticationHandlerExecutionResultdoAuthentication(org.apereo.cas.authentication.Credential credential)Performs the details of authentication and returns an authentication handler result on success.-
Methods inherited from interface org.apereo.cas.authentication.AuthenticationHandler
getName, getOrder, supports, supports
-
-
-
-
Constructor Detail
-
AbstractPreAndPostProcessingAuthenticationHandler
public AbstractPreAndPostProcessingAuthenticationHandler(java.lang.String name, org.apereo.cas.services.ServicesManager servicesManager, org.apereo.cas.authentication.principal.PrincipalFactory principalFactory, java.lang.Integer order)
-
-
Method Detail
-
authenticate
public org.apereo.cas.authentication.AuthenticationHandlerExecutionResult authenticate(org.apereo.cas.authentication.Credential credential) throws java.security.GeneralSecurityException, org.apereo.cas.authentication.PreventedException- Specified by:
authenticatein interfaceorg.apereo.cas.authentication.AuthenticationHandler- Throws:
java.security.GeneralSecurityExceptionorg.apereo.cas.authentication.PreventedException
-
doAuthentication
protected abstract org.apereo.cas.authentication.AuthenticationHandlerExecutionResult doAuthentication(org.apereo.cas.authentication.Credential credential) throws java.security.GeneralSecurityException, org.apereo.cas.authentication.PreventedExceptionPerforms the details of authentication and returns an authentication handler result on success.- Parameters:
credential- Credential to authenticate.- Returns:
- Authentication handler result on success.
- Throws:
java.security.GeneralSecurityException- On authentication failure that is thrown out to the caller ofauthenticate(Credential).org.apereo.cas.authentication.PreventedException- On the indeterminate case when authentication is prevented.
-
createHandlerResult
protected org.apereo.cas.authentication.AuthenticationHandlerExecutionResult createHandlerResult(@NonNull org.apereo.cas.authentication.Credential credential, @NonNull org.apereo.cas.authentication.principal.Principal principal, java.util.List<org.apereo.cas.authentication.MessageDescriptor> warnings)Helper method to construct a handler result on successful authentication events.- Parameters:
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 warnings- Returns:
- the constructed handler result
-
createHandlerResult
protected org.apereo.cas.authentication.AuthenticationHandlerExecutionResult createHandlerResult(@NonNull org.apereo.cas.authentication.Credential credential, @NonNull org.apereo.cas.authentication.principal.Principal principal)Helper method to construct a handler result on successful authentication events.- Parameters:
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- Returns:
- the constructed handler result
-
-