Class CIBAErrorResponse

java.lang.Object
com.nimbusds.oauth2.sdk.ciba.CIBAResponse
com.nimbusds.oauth2.sdk.ciba.CIBAErrorResponse
All Implemented Interfaces:
ErrorResponse, Message, Response

@Immutable public class CIBAErrorResponse extends CIBAResponse implements ErrorResponse
CIBA error response from an OpenID provider / OAuth 2.0 authorisation server backend authentication endpoint.

Standard CIBA errors:

Example HTTP response:

 HTTP/1.1 400 Bad Request
 Content-Type: application/json

 {
   "error": "unauthorized_client",
   "error_description": "The client 'client.example.org' is not allowed to use CIBA"
 }
 

Related specifications:

  • OpenID Connect CIBA Flow - Core 1.0, sections 11, 12 and 13.
  • Constructor Details

    • CIBAErrorResponse

      protected CIBAErrorResponse()
      Creates a new CIBA error response. No OAuth 2.0 error is specified.
    • CIBAErrorResponse

      Creates a new CIBA error response.
      Parameters:
      error - The error. Should match one of the standard errors for a CIBA error response. Must not be null.
  • Method Details

    • getStandardErrors

      public static Set<ErrorObject> getStandardErrors()
      Gets the standard OAuth 2.0 errors for a CIBA error response.
      Returns:
      The standard errors, as a read-only set.
    • indicatesSuccess

      public boolean indicatesSuccess()
      Description copied from interface: Response
      Checks if the response indicates success.
      Specified by:
      indicatesSuccess in interface Response
      Returns:
      true if the response indicates success, else false.
    • getErrorObject

      Description copied from interface: ErrorResponse
      Gets the error associated with the error response.
      Specified by:
      getErrorObject in interface ErrorResponse
      Returns:
      The error, null if none.
    • toJSONObject

      public net.minidev.json.JSONObject toJSONObject()
      Returns the JSON object for this CIBA error response.
      Returns:
      The JSON object for this CIBA error response.
    • toHTTPResponse

      Description copied from interface: Response
      Returns the matching HTTP response.
      Specified by:
      toHTTPResponse in interface Response
      Returns:
      The HTTP response.
    • parse

      public static CIBAErrorResponse parse(net.minidev.json.JSONObject jsonObject) throws ParseException
      Parses a CIBA error response from the specified JSON object.
      Parameters:
      jsonObject - The JSON object to parse. Its status code must not be 200 (OK). Must not be null.
      Returns:
      The CIBA error response.
      Throws:
      ParseException - If parsing failed.
    • parse

      public static CIBAErrorResponse parse(HTTPResponse httpResponse) throws ParseException
      Parses a CIBA error response from the specified HTTP response.
      Parameters:
      httpResponse - The HTTP response to parse. Its status code must not be 200 (OK). Must not be null.
      Returns:
      The CIBA error response.
      Throws:
      ParseException - If parsing failed.