Package com.nimbusds.oauth2.sdk.ciba
Class CIBAErrorResponse
java.lang.Object
com.nimbusds.oauth2.sdk.ciba.CIBAResponse
com.nimbusds.oauth2.sdk.ciba.CIBAErrorResponse
- All Implemented Interfaces:
ErrorResponse,Message,Response
CIBA error response from an OpenID provider / OAuth 2.0 authorisation server
backend authentication endpoint.
Standard CIBA errors:
OAuth2Error.INVALID_REQUESTOAuth2Error.INVALID_SCOPEOAuth2Error.INVALID_CLIENTOAuth2Error.UNAUTHORIZED_CLIENTOAuth2Error.ACCESS_DENIEDCIBAError.EXPIRED_LOGIN_HINT_TOKENCIBAError.UNKNOWN_USER_IDCIBAError.MISSING_USER_CODECIBAError.INVALID_USER_CODECIBAError.INVALID_BINDING_MESSAGE
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 Summary
ConstructorsModifierConstructorDescriptionprotectedCreates a new CIBA error response.CIBAErrorResponse(ErrorObject error) Creates a new CIBA error response. -
Method Summary
Modifier and TypeMethodDescriptionGets the error associated with the error response.static Set<ErrorObject>Gets the standard OAuth 2.0 errors for a CIBA error response.booleanChecks if the response indicates success.static CIBAErrorResponseparse(HTTPResponse httpResponse) Parses a CIBA error response from the specified HTTP response.static CIBAErrorResponseparse(net.minidev.json.JSONObject jsonObject) Parses a CIBA error response from the specified JSON object.Returns the matching HTTP response.net.minidev.json.JSONObjectReturns the JSON object for this CIBA error response.Methods inherited from class com.nimbusds.oauth2.sdk.ciba.CIBAResponse
toErrorResponse, toRequestAcknowledgement
-
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 thestandard errorsfor a CIBA error response. Must not benull.
-
-
Method Details
-
getStandardErrors
Gets the standard OAuth 2.0 errors for a CIBA error response.- Returns:
- The standard errors, as a read-only set.
-
indicatesSuccess
Description copied from interface:ResponseChecks if the response indicates success.- Specified by:
indicatesSuccessin interfaceResponse- Returns:
trueif the response indicates success, elsefalse.
-
getErrorObject
Description copied from interface:ErrorResponseGets the error associated with the error response.- Specified by:
getErrorObjectin interfaceErrorResponse- Returns:
- The error,
nullif none.
-
toJSONObject
Returns the JSON object for this CIBA error response.- Returns:
- The JSON object for this CIBA error response.
-
toHTTPResponse
Description copied from interface:ResponseReturns the matching HTTP response.- Specified by:
toHTTPResponsein interfaceResponse- Returns:
- The HTTP response.
-
parse
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 benull.- Returns:
- The CIBA error response.
- Throws:
ParseException- If parsing failed.
-
parse
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 benull.- Returns:
- The CIBA error response.
- Throws:
ParseException- If parsing failed.
-