Class UsernamePasswordWrapperAuthenticationHandler

  • All Implemented Interfaces:
    org.apereo.cas.authentication.AuthenticationHandler, org.apereo.cas.authentication.PrePostAuthenticationHandler, org.springframework.core.Ordered

    public class UsernamePasswordWrapperAuthenticationHandler
    extends AbstractWrapperAuthenticationHandler<org.apereo.cas.authentication.credential.UsernamePasswordCredential,​org.pac4j.core.credentials.UsernamePasswordCredentials>
    Pac4j authentication handler which works on a CAS username / password credential and uses a pac4j authenticator and profile creator to play authentication.
    Since:
    4.2.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.pac4j.core.credentials.authenticator.Authenticator authenticator
      The underlying pac4j authenticator.
      • 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 
      Constructor Description
      UsernamePasswordWrapperAuthenticationHandler​(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 Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected org.pac4j.core.credentials.UsernamePasswordCredentials convertToPac4jCredentials​(org.apereo.cas.authentication.credential.UsernamePasswordCredential casCredential)
      Convert a CAS credential into a pac4j credentials to play the authentication.
      protected org.pac4j.core.credentials.authenticator.Authenticator getAuthenticator​(org.apereo.cas.authentication.Credential credential)
      Gets authenticator.
      protected java.lang.Class<org.apereo.cas.authentication.credential.UsernamePasswordCredential> getCasCredentialsType()
      Return the CAS credential supported by this handler (to be converted in a pac4j credentials by AbstractWrapperAuthenticationHandler.convertToPac4jCredentials(Credential)).
      boolean supports​(java.lang.Class<? extends org.apereo.cas.authentication.Credential> clazz)  
      • 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
      • Methods inherited from interface org.apereo.cas.authentication.PrePostAuthenticationHandler

        postAuthenticate, preAuthenticate
    • Field Detail

      • authenticator

        protected org.pac4j.core.credentials.authenticator.Authenticator authenticator
        The underlying pac4j authenticator.
    • Constructor Detail

      • UsernamePasswordWrapperAuthenticationHandler

        public UsernamePasswordWrapperAuthenticationHandler​(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

      • supports

        public boolean supports​(java.lang.Class<? extends org.apereo.cas.authentication.Credential> clazz)
      • convertToPac4jCredentials

        protected org.pac4j.core.credentials.UsernamePasswordCredentials convertToPac4jCredentials​(org.apereo.cas.authentication.credential.UsernamePasswordCredential casCredential)
                                                                                            throws java.security.GeneralSecurityException
        Description copied from class: AbstractWrapperAuthenticationHandler
        Convert a CAS credential into a pac4j credentials to play the authentication.
        Specified by:
        convertToPac4jCredentials in class AbstractWrapperAuthenticationHandler<org.apereo.cas.authentication.credential.UsernamePasswordCredential,​org.pac4j.core.credentials.UsernamePasswordCredentials>
        Parameters:
        casCredential - the CAS credential
        Returns:
        the pac4j credentials
        Throws:
        java.security.GeneralSecurityException - On authentication failure.
      • getAuthenticator

        protected org.pac4j.core.credentials.authenticator.Authenticator getAuthenticator​(org.apereo.cas.authentication.Credential credential)
        Description copied from class: AbstractWrapperAuthenticationHandler
        Gets authenticator.
        Specified by:
        getAuthenticator in class AbstractWrapperAuthenticationHandler<org.apereo.cas.authentication.credential.UsernamePasswordCredential,​org.pac4j.core.credentials.UsernamePasswordCredentials>
        Parameters:
        credential - the credential
        Returns:
        the authenticator