Class TerminateAuthenticationChainException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.springframework.security.core.AuthenticationException
org.springframework.security.authentication.AccountStatusException
com.appiancorp.suiteapi.security.auth.TerminateAuthenticationChainException
All Implemented Interfaces:
Serializable

public final class TerminateAuthenticationChainException extends org.springframework.security.authentication.AccountStatusException

This exception could be thrown by an AuthenticationProvider to stop authenticating against other available AuthenticationProviders and immediately fail authentication.

To instantiate this exception, one must provide an AuthenticationException as the cause, which will then be handled appropriately by the framework.

For instance, if an AuthenticationProvider decides to terminate the chain of authentication against all the available AuthenticationProviders due to failed authentication, it can throw a new TerminateAuthenticationChainException with BadCredentialsException as the cause. Following is a sample code snippet to do so:

     AuthenticationException cause = new BadCredentialsException("invalid credentials");
     throw new TerminateAuthenticationChainException(cause);
 
See Also:
  • Constructor Details

    • TerminateAuthenticationChainException

      public TerminateAuthenticationChainException(org.springframework.security.core.AuthenticationException cause)
      Parameters:
      cause - an AuthenticationException
      Throws:
      NullPointerException - this exception will be thrown if the cause is null
  • Method Details

    • getCause

      public org.springframework.security.core.AuthenticationException getCause()
      Overrides:
      getCause in class Throwable