Class AbstractWrapperAuthenticationHandler<I extends org.apereo.cas.authentication.Credential,​C extends org.pac4j.core.credentials.Credentials>

  • 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 profileCreator
      The pac4j profile creator used for authentication.
      • 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​(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 C convertToPac4jCredentials​(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 java.lang.Class<I> getCasCredentialsType()
      Return the CAS credential supported by this handler (to be converted in a pac4j credentials by convertToPac4jCredentials(Credential)).
      protected static org.pac4j.core.context.WebContext getWebContext()
      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 Detail

      • profileCreator

        @NonNull
        protected @NonNull org.pac4j.core.profile.creator.ProfileCreator profileCreator
        The pac4j profile creator used for authentication.
    • 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,
                                                                                                      org.apereo.cas.authentication.principal.Service service)
                                                                                               throws java.security.GeneralSecurityException
        Specified by:
        doAuthentication in class org.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 by convertToPac4jCredentials(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