Package com.nimbusds.oauth2.sdk.client
Class ClientRegistrationErrorResponse
- java.lang.Object
-
- com.nimbusds.oauth2.sdk.client.ClientRegistrationResponse
-
- com.nimbusds.oauth2.sdk.client.ClientRegistrationErrorResponse
-
- All Implemented Interfaces:
ErrorResponse,Message,Response
@Immutable public class ClientRegistrationErrorResponse extends ClientRegistrationResponse implements ErrorResponse
Client registration error response.Standard errors:
- OAuth 2.0 Bearer Token errors:
- OpenID Connect specific errors:
Example HTTP response:
HTTP/1.1 400 Bad Request Content-Type: application/json Cache-Control: no-store Pragma: no-cache { "error":"invalid_redirect_uri", "error_description":"The redirection URI of http://sketchy.example.com is not allowed for this server." }Related specifications:
- OAuth 2.0 Dynamic Client Registration Protocol (RFC 7591), section 3.2.2.
- OAuth 2.0 Bearer Token Usage (RFC 6750), section 3.1.
-
-
Constructor Summary
Constructors Constructor Description ClientRegistrationErrorResponse(ErrorObject error)Creates a new client registration error response.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ErrorObjectgetErrorObject()Gets the error associated with the error response.static Set<ErrorObject>getStandardErrors()Gets the standard errors for a client registration error response.booleanindicatesSuccess()Checks if the response indicates success.static ClientRegistrationErrorResponseparse(HTTPResponse httpResponse)Parses a client registration error response from the specified HTTP response.HTTPResponsetoHTTPResponse()Returns the HTTP response for this client registration error response.-
Methods inherited from class com.nimbusds.oauth2.sdk.client.ClientRegistrationResponse
toErrorResponse, toSuccessResponse
-
-
-
-
Constructor Detail
-
ClientRegistrationErrorResponse
public ClientRegistrationErrorResponse(ErrorObject error)
Creates a new client registration error response.- Parameters:
error- The error. Should match one of thestandard errorsfor a client registration error response. Must not benull.
-
-
Method Detail
-
getStandardErrors
public static Set<ErrorObject> getStandardErrors()
Gets the standard errors for a client registration error response.- Returns:
- The standard errors, as a read-only set.
-
indicatesSuccess
public boolean indicatesSuccess()
Description copied from interface:ResponseChecks if the response indicates success.- Specified by:
indicatesSuccessin interfaceResponse- Returns:
trueif the response indicates success, elsefalse.
-
getErrorObject
public ErrorObject getErrorObject()
Description copied from interface:ErrorResponseGets the error associated with the error response.- Specified by:
getErrorObjectin interfaceErrorResponse- Returns:
- The error,
nullif none.
-
toHTTPResponse
public HTTPResponse toHTTPResponse()
Returns the HTTP response for this client registration error response.Example HTTP response:
HTTP/1.1 400 Bad Request Content-Type: application/json Cache-Control: no-store Pragma: no-cache { "error":"invalid_redirect_uri", "error_description":"The redirection URI of http://sketchy.example.com is not allowed for this server." }- Specified by:
toHTTPResponsein interfaceResponse- Returns:
- The HTTP response.
-
parse
public static ClientRegistrationErrorResponse parse(HTTPResponse httpResponse) throws ParseException
Parses a client registration error response from the specified HTTP response.Note: The HTTP status code is not checked for matching the error code semantics.
- Parameters:
httpResponse- The HTTP response to parse. Its status code must not be 200 (OK). Must not benull.- Returns:
- The client registration error response.
- Throws:
ParseException- If the HTTP response couldn't be parsed to a client registration error response.
-
-