java.lang.Object
africa.absa.inception.oauth2.server.authorization.controller.Response
africa.absa.inception.oauth2.server.authorization.controller.ErrorResponse
Direct Known Subclasses:
InvalidClientErrorResponse, InvalidGrantErrorResponse, InvalidRequestErrorResponse, InvalidScopeErrorResponse, UnauthorizedClientErrorResponse, UnsupportedGrantTypeErrorResponse

public abstract class ErrorResponse extends Response
The ErrorGrantResponse class holds the information for an OAuth2 error response and provides the base class that all OAuth2 error response classes should be derived from.

See: Error Response

Author:
Marcus Portmann
  • Constructor Details

    • ErrorResponse

      public ErrorResponse(org.springframework.http.HttpStatus status, String error)
      Constructs a new ErrorGrantResponse.
      Parameters:
      status - the HTTP status that should be returned for the OAuth2 error response
      error - the single ASCII error code
    • ErrorResponse

      public ErrorResponse(org.springframework.http.HttpStatus status, String error, String errorDescription)
      Constructs a new ErrorResponse.
      Parameters:
      status - the HTTP status that should be returned for the OAuth2 error response
      error - the single ASCII error code
      errorDescription - the optional human-readable ASCII text description of the error
  • Method Details

    • getBody

      public String getBody()
      Returns the body for the OAuth2 response.
      Specified by:
      getBody in class Response
      Returns:
      the body for the OAuth2 response
    • getError

      public String getError()
      Returns the single ASCII error code.
      Returns:
      the single ASCII error code
    • getErrorDescription

      public String getErrorDescription()
      Returns the optional human-readable ASCII text description of the error.
      Returns:
      the optional human-readable ASCII text description of the error