Class OAuth2AuthenticationException

All Implemented Interfaces:
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:
  • Constructor Details

    • OAuth2AuthenticationException

      public OAuth2AuthenticationException(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, 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, 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, String message, Throwable cause)
      Constructs an OAuth2AuthenticationException using the provided parameters.
      Parameters:
      error - the OAuth 2.0 Error
      message - the detail message
      cause - the root cause
  • Method Details