Class OAuth2AuthenticationException

  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    InvalidBearerTokenException

    public class OAuth2AuthenticationException
    extends AuthenticationException
    This exception is thrown for all OAuth 2.0 related Authentication errors.

    There are a number of scenarios where an error may occur, for example:

    • The authorization request or token request is missing a required parameter
    • Missing or invalid client identifier
    • Invalid or mismatching redirection URI
    • The requested scope is invalid, unknown, or malformed
    • The resource owner or authorization server denied the access request
    • Client authentication failed
    • The provided authorization grant (authorization code, resource owner credentials) is invalid, expired, or revoked
    Since:
    5.0
    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      OAuth2Error getError()
      Returns the OAuth 2.0 Error.
      • 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

      • OAuth2AuthenticationException

        public OAuth2AuthenticationException​(java.lang.String errorCode)
        Constructs an OAuth2AuthenticationException using the provided parameters.
        Parameters:
        errorCode - the OAuth 2.0 Error Code
        Since:
        5.5
      • OAuth2AuthenticationException

        public OAuth2AuthenticationException​(OAuth2Error error)
        Constructs an OAuth2AuthenticationException using the provided parameters.
        Parameters:
        error - the OAuth 2.0 Error
      • OAuth2AuthenticationException

        public OAuth2AuthenticationException​(OAuth2Error error,
                                             java.lang.Throwable cause)
        Constructs an OAuth2AuthenticationException using the provided parameters.
        Parameters:
        error - the OAuth 2.0 Error
        cause - the root cause
      • OAuth2AuthenticationException

        public OAuth2AuthenticationException​(OAuth2Error error,
                                             java.lang.String message)
        Constructs an OAuth2AuthenticationException using the provided parameters.
        Parameters:
        error - the OAuth 2.0 Error
        message - the detail message
      • OAuth2AuthenticationException

        public OAuth2AuthenticationException​(OAuth2Error error,
                                             java.lang.String message,
                                             java.lang.Throwable cause)
        Constructs an OAuth2AuthenticationException using the provided parameters.
        Parameters:
        error - the OAuth 2.0 Error
        message - the detail message
        cause - the root cause