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 parameter
C - 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.ProfileCreator
    The 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

    Fields inherited from interface org.apereo.cas.authentication.AuthenticationHandler

    SUCCESSFUL_AUTHENTICATION_HANDLERS

    Fields inherited from interface org.springframework.core.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    AbstractWrapperAuthenticationHandler(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 Type
    Method
    Description
    protected abstract C
    convertToCredentials(I casCredential)
    Convert a CAS credential into a pac4j credentials to play the authentication.
    protected org.apereo.cas.authentication.AuthenticationHandlerExecutionResult
    doAuthentication(org.apereo.cas.authentication.Credential credential, org.apereo.cas.authentication.principal.Service service)
     
    protected abstract org.pac4j.core.credentials.authenticator.Authenticator
    getAuthenticator(org.apereo.cas.authentication.Credential credential)
    Gets authenticator.
    protected abstract Class<I>
    Return the CAS credential supported by this handler (to be converted in a pac4j credentials by convertToCredentials(Credential)).
    protected static org.pac4j.core.context.WebContext
    Gets the web context from the current thread-bound object.
    boolean
    supports(org.apereo.cas.authentication.Credential credential)
     

    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

    Methods inherited from interface org.apereo.cas.authentication.AuthenticationHandler

    getName, getOrder, getState, supports

    Methods inherited from interface org.apereo.cas.authentication.PrePostAuthenticationHandler

    postAuthenticate, preAuthenticate
  • Field Details

    • profileCreator

      @NonNull protected @NonNull org.pac4j.core.profile.creator.ProfileCreator profileCreator
      The pac4j profile creator used for authentication.
  • Constructor Details

    • AbstractWrapperAuthenticationHandler

      protected AbstractWrapperAuthenticationHandler(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 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:
      doAuthentication in class org.apereo.cas.authentication.handler.support.AbstractPreAndPostProcessingAuthenticationHandler
      Throws:
      GeneralSecurityException
    • convertToCredentials

      protected abstract C convertToCredentials(I casCredential) throws GeneralSecurityException
      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

      protected abstract Class<I> getCasCredentialsType()
      Return the CAS credential supported by this handler (to be converted in a pac4j credentials by convertToCredentials(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