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
Fields Modifier and Type Field Description protected @NonNull org.pac4j.core.profile.creator.ProfileCreatorprofileCreatorThe pac4j profile creator used for authentication.-
Fields inherited from class org.apereo.cas.integration.pac4j.authentication.handler.support.AbstractPac4jAuthenticationHandler
sessionStore
-
Fields inherited from class org.apereo.cas.authentication.AbstractAuthenticationHandler
principalFactory
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractWrapperAuthenticationHandler(java.lang.String name, org.apereo.cas.services.ServicesManager servicesManager, org.apereo.cas.authentication.principal.PrincipalFactory principalFactory, java.lang.Integer order, org.pac4j.core.context.session.SessionStore sessionStore)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract CconvertToPac4jCredentials(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)protected abstract org.pac4j.core.credentials.authenticator.AuthenticatorgetAuthenticator(org.apereo.cas.authentication.Credential credential)Gets authenticator.protected abstract java.lang.Class<I>getCasCredentialsType()Return the CAS credential supported by this handler (to be converted in a pac4j credentials byconvertToPac4jCredentials(Credential)).protected static org.pac4j.core.context.WebContextgetWebContext()Gets 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, preFinalizeAuthenticationHandlerResult, storeUserProfile
-
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
-
-
-
-
Constructor Detail
-
AbstractWrapperAuthenticationHandler
protected AbstractWrapperAuthenticationHandler(java.lang.String name, org.apereo.cas.services.ServicesManager servicesManager, org.apereo.cas.authentication.principal.PrincipalFactory principalFactory, java.lang.Integer order, org.pac4j.core.context.session.SessionStore sessionStore)
-
-
Method Detail
-
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) throws java.security.GeneralSecurityException- Specified by:
doAuthenticationin classorg.apereo.cas.authentication.handler.support.AbstractPreAndPostProcessingAuthenticationHandler- Throws:
java.security.GeneralSecurityException
-
convertToPac4jCredentials
protected abstract C convertToPac4jCredentials(I casCredential) throws java.security.GeneralSecurityException
Convert a CAS credential into a pac4j credentials to play the authentication.- Parameters:
casCredential- the CAS credential- Returns:
- the pac4j credentials
- Throws:
java.security.GeneralSecurityException- On authentication failure.
-
getCasCredentialsType
protected abstract java.lang.Class<I> getCasCredentialsType()
Return the CAS credential supported by this handler (to be converted in a pac4j credentials byconvertToPac4jCredentials(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
-
-