Class OAuth2Error

java.lang.Object
org.springframework.security.oauth2.core.OAuth2Error
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
BearerTokenError

public class OAuth2Error extends Object implements Serializable
A representation of an OAuth 2.0 Error.

At a minimum, an error response will contain an error code. The error code may be one of the standard codes defined by the specification, or a new code defined in the OAuth Extensions Error Registry, for cases where protocol extensions require additional error code(s) above the standard codes.

Since:
5.0
See Also:
  • Constructor Details

    • OAuth2Error

      public OAuth2Error(String errorCode)
      Constructs an OAuth2Error using the provided parameters.
      Parameters:
      errorCode - the error code
    • OAuth2Error

      public OAuth2Error(String errorCode, String description, String uri)
      Constructs an OAuth2Error using the provided parameters.
      Parameters:
      errorCode - the error code
      description - the error description
      uri - the error uri
  • Method Details

    • getErrorCode

      public final String getErrorCode()
      Returns the error code.
      Returns:
      the error code
    • getDescription

      public final String getDescription()
      Returns the error description.
      Returns:
      the error description
    • getUri

      public final String getUri()
      Returns the error uri.
      Returns:
      the error uri
    • toString

      public String toString()
      Overrides:
      toString in class Object