Class AbstractWrapperAuthenticationHandler<I extends org.apereo.cas.authentication.Credential,C extends org.pac4j.core.credentials.Credentials>
java.lang.Object
org.apereo.cas.authentication.AbstractAuthenticationHandler
org.apereo.cas.authentication.handler.support.AbstractPreAndPostProcessingAuthenticationHandler
org.apereo.cas.integration.pac4j.authentication.handler.support.AbstractPac4jAuthenticationHandler
org.apereo.cas.integration.pac4j.authentication.handler.support.AbstractWrapperAuthenticationHandler<I,C>
- Type Parameters:
I- the type parameterC- the type parameter
- All Implemented Interfaces:
org.apereo.cas.authentication.AuthenticationHandler,org.apereo.cas.authentication.PrePostAuthenticationHandler,org.springframework.core.Ordered
- Direct Known Subclasses:
AbstractTokenWrapperAuthenticationHandler,UsernamePasswordWrapperAuthenticationHandler
public abstract class AbstractWrapperAuthenticationHandler<I extends org.apereo.cas.authentication.Credential,C extends org.pac4j.core.credentials.Credentials>
extends AbstractPac4jAuthenticationHandler
Abstract pac4j authentication handler which uses a pac4j authenticator and profile creator.
- Since:
- 4.2.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected @NonNull org.pac4j.core.profile.creator.ProfileCreatorThe pac4j profile creator used for authentication.Fields inherited from class org.apereo.cas.integration.pac4j.authentication.handler.support.AbstractPac4jAuthenticationHandler
sessionStoreFields inherited from class org.apereo.cas.authentication.AbstractAuthenticationHandler
principalFactoryFields inherited from interface org.apereo.cas.authentication.AuthenticationHandler
SUCCESSFUL_AUTHENTICATION_HANDLERSFields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractWrapperAuthenticationHandler(String name, org.apereo.cas.services.ServicesManager servicesManager, org.apereo.cas.authentication.principal.PrincipalFactory principalFactory, Integer order, org.pac4j.core.context.session.SessionStore sessionStore) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract CconvertToCredentials(I casCredential) Convert a CAS credential into a pac4j credentials to play the authentication.protected org.apereo.cas.authentication.AuthenticationHandlerExecutionResultdoAuthentication(org.apereo.cas.authentication.Credential credential, org.apereo.cas.authentication.principal.Service service) protected abstract org.pac4j.core.credentials.authenticator.AuthenticatorgetAuthenticator(org.apereo.cas.authentication.Credential credential) Gets authenticator.Return the CAS credential supported by this handler (to be converted in a pac4j credentials byconvertToCredentials(Credential)).protected static org.pac4j.core.context.WebContextGets the web context from the current thread-bound object.booleansupports(org.apereo.cas.authentication.Credential credential) Methods inherited from class org.apereo.cas.integration.pac4j.authentication.handler.support.AbstractPac4jAuthenticationHandler
createResult, determinePrincipalIdFrom, finalizeAuthenticationHandlerResult, finalizeAuthenticationPrincipal, postFinalizeAuthenticationHandlerResult, preFinalizeAuthenticationHandlerResult, storeUserProfileMethods inherited from class org.apereo.cas.authentication.handler.support.AbstractPreAndPostProcessingAuthenticationHandler
authenticate, createHandlerResult, createHandlerResultMethods inherited from class org.apereo.cas.authentication.AbstractAuthenticationHandler
canEqual, equals, getCredentialSelectionPredicate, getName, getOrder, getPrincipalFactory, getServicesManager, getState, hashCode, setCredentialSelectionPredicate, setStateMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apereo.cas.authentication.AuthenticationHandler
getName, getOrder, getState, supportsMethods inherited from interface org.apereo.cas.authentication.PrePostAuthenticationHandler
postAuthenticate, preAuthenticate
-
Field Details
-
profileCreator
@NonNull protected @NonNull org.pac4j.core.profile.creator.ProfileCreator profileCreatorThe pac4j profile creator used for authentication.
-
-
Constructor Details
-
AbstractWrapperAuthenticationHandler
-
-
Method Details
-
getWebContext
protected static org.pac4j.core.context.WebContext getWebContext()Gets the web context from the current thread-bound object.- Returns:
- the web context
-
supports
public boolean supports(org.apereo.cas.authentication.Credential credential) -
doAuthentication
protected org.apereo.cas.authentication.AuthenticationHandlerExecutionResult doAuthentication(org.apereo.cas.authentication.Credential credential, org.apereo.cas.authentication.principal.Service service) throws GeneralSecurityException - Specified by:
doAuthenticationin classorg.apereo.cas.authentication.handler.support.AbstractPreAndPostProcessingAuthenticationHandler- Throws:
GeneralSecurityException
-
convertToCredentials
Convert a CAS credential into a pac4j credentials to play the authentication.- Parameters:
casCredential- the CAS credential- Returns:
- the pac4j credentials
- Throws:
GeneralSecurityException- On authentication failure.
-
getCasCredentialsType
Return the CAS credential supported by this handler (to be converted in a pac4j credentials byconvertToCredentials(Credential)).- Returns:
- the CAS credential class
-
getAuthenticator
protected abstract org.pac4j.core.credentials.authenticator.Authenticator getAuthenticator(org.apereo.cas.authentication.Credential credential) Gets authenticator.- Parameters:
credential- the credential- Returns:
- the authenticator
-