Class AbstractPreAndPostProcessingAuthenticationHandler

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

    public abstract class AbstractPreAndPostProcessingAuthenticationHandler
    extends AbstractAuthenticationHandler
    implements org.apereo.cas.authentication.PrePostAuthenticationHandler
    Abstract authentication handler that allows deployers to utilize the bundled AuthenticationHandlers while providing a mechanism to perform tasks before and after authentication.
    Since:
    3.1
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AbstractPreAndPostProcessingAuthenticationHandler​(java.lang.String name, org.apereo.cas.services.ServicesManager servicesManager, org.apereo.cas.authentication.principal.PrincipalFactory principalFactory, java.lang.Integer order)  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      org.apereo.cas.authentication.AuthenticationHandlerExecutionResult authenticate​(org.apereo.cas.authentication.Credential credential)  
      protected org.apereo.cas.authentication.AuthenticationHandlerExecutionResult createHandlerResult​(@NonNull org.apereo.cas.authentication.Credential credential, @NonNull org.apereo.cas.authentication.principal.Principal principal)
      Helper method to construct a handler result on successful authentication events.
      protected org.apereo.cas.authentication.AuthenticationHandlerExecutionResult createHandlerResult​(@NonNull org.apereo.cas.authentication.Credential credential, @NonNull org.apereo.cas.authentication.principal.Principal principal, @NonNull java.util.List<org.apereo.cas.authentication.MessageDescriptor> warnings)
      Helper method to construct a handler result on successful authentication events.
      protected abstract org.apereo.cas.authentication.AuthenticationHandlerExecutionResult doAuthentication​(org.apereo.cas.authentication.Credential credential)
      Performs the details of authentication and returns an authentication handler result on success.
      • 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, supports, supports
      • Methods inherited from interface org.apereo.cas.authentication.PrePostAuthenticationHandler

        postAuthenticate, preAuthenticate
    • Constructor Detail

      • AbstractPreAndPostProcessingAuthenticationHandler

        protected AbstractPreAndPostProcessingAuthenticationHandler​(java.lang.String name,
                                                                    org.apereo.cas.services.ServicesManager servicesManager,
                                                                    org.apereo.cas.authentication.principal.PrincipalFactory principalFactory,
                                                                    java.lang.Integer order)
    • Method Detail

      • authenticate

        public org.apereo.cas.authentication.AuthenticationHandlerExecutionResult authenticate​(org.apereo.cas.authentication.Credential credential)
                                                                                        throws java.security.GeneralSecurityException,
                                                                                               org.apereo.cas.authentication.PreventedException
        Specified by:
        authenticate in interface org.apereo.cas.authentication.AuthenticationHandler
        Throws:
        java.security.GeneralSecurityException
        org.apereo.cas.authentication.PreventedException
      • doAuthentication

        protected abstract org.apereo.cas.authentication.AuthenticationHandlerExecutionResult doAuthentication​(org.apereo.cas.authentication.Credential credential)
                                                                                                        throws java.security.GeneralSecurityException,
                                                                                                               org.apereo.cas.authentication.PreventedException
        Performs the details of authentication and returns an authentication handler result on success.
        Parameters:
        credential - Credential to authenticate.
        Returns:
        Authentication handler result on success.
        Throws:
        java.security.GeneralSecurityException - On authentication failure that is thrown out to the caller of authenticate(Credential).
        org.apereo.cas.authentication.PreventedException - On the indeterminate case when authentication is prevented.
      • createHandlerResult

        protected org.apereo.cas.authentication.AuthenticationHandlerExecutionResult createHandlerResult​(@NonNull
                                                                                                         @NonNull org.apereo.cas.authentication.Credential credential,
                                                                                                         @NonNull
                                                                                                         @NonNull org.apereo.cas.authentication.principal.Principal principal,
                                                                                                         @NonNull
                                                                                                         @NonNull java.util.List<org.apereo.cas.authentication.MessageDescriptor> warnings)
        Helper method to construct a handler result on successful authentication events.
        Parameters:
        credential - the credential on which the authentication was successfully performed. Note that this credential instance may be different from what was originally provided as transformation of the username may have occurred, if one is in fact defined.
        principal - the resolved principal
        warnings - the warnings
        Returns:
        the constructed handler result
      • createHandlerResult

        protected org.apereo.cas.authentication.AuthenticationHandlerExecutionResult createHandlerResult​(@NonNull
                                                                                                         @NonNull org.apereo.cas.authentication.Credential credential,
                                                                                                         @NonNull
                                                                                                         @NonNull org.apereo.cas.authentication.principal.Principal principal)
        Helper method to construct a handler result on successful authentication events.
        Parameters:
        credential - the credential on which the authentication was successfully performed. Note that this credential instance may be different from what was originally provided as transformation of the username may have occurred, if one is in fact defined.
        principal - the resolved principal
        Returns:
        the constructed handler result