Class AuthenticationException

  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    PrincipalException, UnauthorizedAuthenticationException

    public class AuthenticationException
    extends java.lang.RuntimeException
    Authentication raised by AuthenticationManager to signal authentication failure. Authentication failure typically occurs when one or more AuthenticationHandler components fail to authenticate credentials. This exception contains information about handler successes and failures that may be used by higher-level components to determine subsequent behavior.
    Since:
    4.0.0
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      AuthenticationException()
      Instantiates a new Authentication exception.
      AuthenticationException​(java.lang.String msg)
      Creates a new instance for the case when no handlers were attempted, i.e.
      AuthenticationException​(java.lang.String message, java.util.Map<java.lang.String,​java.lang.Throwable> handlerErrors, java.util.Map<java.lang.String,​AuthenticationHandlerExecutionResult> handlerSuccesses)
      Creates a new instance for the case when there are both handler successes and failures and a custom error message is required.
      AuthenticationException​(java.util.Map<java.lang.String,​java.lang.Throwable> handlerErrors)
      Creates a new instance for the case when no handlers succeeded.
      AuthenticationException​(java.util.Map<java.lang.String,​java.lang.Throwable> handlerErrors, java.util.Map<java.lang.String,​AuthenticationHandlerExecutionResult> handlerSuccesses)
      Creates a new instance for the case when there are both handler successes and failures.
    • Method Summary

      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • AuthenticationException

        public AuthenticationException​(java.lang.String msg)
        Creates a new instance for the case when no handlers were attempted, i.e. no successes or failures.
        Parameters:
        msg - the msg
      • AuthenticationException

        public AuthenticationException()
        Instantiates a new Authentication exception.
      • AuthenticationException

        public AuthenticationException​(java.util.Map<java.lang.String,​java.lang.Throwable> handlerErrors)
        Creates a new instance for the case when no handlers succeeded.
        Parameters:
        handlerErrors - Map of handler names to errors.
      • AuthenticationException

        public AuthenticationException​(java.util.Map<java.lang.String,​java.lang.Throwable> handlerErrors,
                                       java.util.Map<java.lang.String,​AuthenticationHandlerExecutionResult> handlerSuccesses)
        Creates a new instance for the case when there are both handler successes and failures.
        Parameters:
        handlerErrors - Map of handler names to errors.
        handlerSuccesses - Map of handler names to authentication successes.
      • AuthenticationException

        public AuthenticationException​(java.lang.String message,
                                       java.util.Map<java.lang.String,​java.lang.Throwable> handlerErrors,
                                       java.util.Map<java.lang.String,​AuthenticationHandlerExecutionResult> handlerSuccesses)
        Creates a new instance for the case when there are both handler successes and failures and a custom error message is required.
        Parameters:
        message - the message associated with this error.
        handlerErrors - Map of handler names to errors.
        handlerSuccesses - Map of handler names to authentication successes.