Class TokenAuthenticationHandler

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

    public class TokenAuthenticationHandler
    extends org.apereo.cas.integration.pac4j.authentication.handler.support.AbstractTokenWrapperAuthenticationHandler
    This is TokenAuthenticationHandler that authenticates instances of TokenCredential. There is no need for a separate PrincipalResolver component as this handler will auto-populate the principal attributes itself.
    Since:
    4.2.0
    • Field Summary

      • Fields inherited from class org.apereo.cas.integration.pac4j.authentication.handler.support.AbstractWrapperAuthenticationHandler

        profileCreator
      • Fields inherited from class org.apereo.cas.authentication.AbstractAuthenticationHandler

        credentialSelectionPredicate, principalFactory, servicesManager
      • 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
      TokenAuthenticationHandler​(java.lang.String name, org.apereo.cas.services.ServicesManager servicesManager, org.apereo.cas.authentication.principal.PrincipalFactory principalFactory, org.apereo.cas.authentication.handler.PrincipalNameTransformer principalNameTransformer)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected org.pac4j.core.credentials.authenticator.Authenticator<org.pac4j.core.credentials.TokenCredentials> getAuthenticator​(org.apereo.cas.authentication.Credential credential)  
      protected java.lang.String getRegisteredServiceJwtProperty​(org.apereo.cas.services.RegisteredService service, org.apereo.cas.services.RegisteredServiceProperty.RegisteredServiceProperties propName)
      Gets registered service jwt secret.
      org.apereo.cas.authentication.AuthenticationHandlerExecutionResult postAuthenticate​(org.apereo.cas.authentication.Credential credential, org.apereo.cas.authentication.AuthenticationHandlerExecutionResult result)  
      • Methods inherited from class org.apereo.cas.integration.pac4j.authentication.handler.support.AbstractTokenWrapperAuthenticationHandler

        convertToPac4jCredentials, getCasCredentialsType, supports
      • Methods inherited from class org.apereo.cas.integration.pac4j.authentication.handler.support.AbstractWrapperAuthenticationHandler

        doAuthentication, getWebContext, setProfileCreator, supports
      • Methods inherited from class org.apereo.cas.integration.pac4j.authentication.handler.support.AbstractPac4jAuthenticationHandler

        createResult, determinePrincipalIdFrom, finalizeAuthenticationHandlerResult, preFinalizeAuthenticationHandlerResult, setPrincipalAttributeId, setTypedIdUsed, storeUserProfile
      • Methods inherited from class org.apereo.cas.authentication.handler.support.AbstractPreAndPostProcessingAuthenticationHandler

        authenticate, createHandlerResult, createHandlerResult
      • Methods inherited from class org.apereo.cas.authentication.AbstractAuthenticationHandler

        getCredentialSelectionPredicate, getName, getOrder, getPrincipalFactory, getServicesManager, setCredentialSelectionPredicate
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.apereo.cas.authentication.AuthenticationHandler

        getName, getOrder
      • Methods inherited from interface org.apereo.cas.authentication.PrePostAuthenticationHandler

        preAuthenticate
    • Constructor Detail

      • TokenAuthenticationHandler

        public TokenAuthenticationHandler​(java.lang.String name,
                                          org.apereo.cas.services.ServicesManager servicesManager,
                                          org.apereo.cas.authentication.principal.PrincipalFactory principalFactory,
                                          org.apereo.cas.authentication.handler.PrincipalNameTransformer principalNameTransformer)
    • Method Detail

      • postAuthenticate

        public org.apereo.cas.authentication.AuthenticationHandlerExecutionResult postAuthenticate​(org.apereo.cas.authentication.Credential credential,
                                                                                                   org.apereo.cas.authentication.AuthenticationHandlerExecutionResult result)
      • getAuthenticator

        protected org.pac4j.core.credentials.authenticator.Authenticator<org.pac4j.core.credentials.TokenCredentials> getAuthenticator​(org.apereo.cas.authentication.Credential credential)
        Specified by:
        getAuthenticator in class org.apereo.cas.integration.pac4j.authentication.handler.support.AbstractWrapperAuthenticationHandler<org.apereo.cas.authentication.credential.BasicIdentifiableCredential,​org.pac4j.core.credentials.TokenCredentials>
      • getRegisteredServiceJwtProperty

        protected java.lang.String getRegisteredServiceJwtProperty​(org.apereo.cas.services.RegisteredService service,
                                                                   org.apereo.cas.services.RegisteredServiceProperty.RegisteredServiceProperties propName)
        Gets registered service jwt secret.
        Parameters:
        service - the service
        propName - the prop name
        Returns:
        the registered service jwt secret