public class InvalidRegistrationException extends Exception
Constructor and Description |
---|
InvalidRegistrationException()
Creates a new invalid client registration exception with a general
invalid_client_metadata error code and description that
doesn't specify the cause. |
InvalidRegistrationException(com.nimbusds.oauth2.sdk.ErrorObject errorObject)
Creates a new invalid client registration exception with the
specified error code and description.
|
InvalidRegistrationException(String field,
String cause)
Creates a new invalid client registration exception, with the error
code set to
invalid_client_metadata and a description
specifying the name of the invalid field and cause. |
Modifier and Type | Method and Description |
---|---|
com.nimbusds.oauth2.sdk.ErrorObject |
getErrorObject()
Returns the associated error object.
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public InvalidRegistrationException()
invalid_client_metadata
error code and description that
doesn't specify the cause.
This will result in the following error response:
HTTP/1.1 400 Bad Request Content-Type: application/json Cache-Control: no-store Pragma: no-cache { "error" : "invalid_client_metadata", "error_description" : "Invalid client metadata field" }
public InvalidRegistrationException(com.nimbusds.oauth2.sdk.ErrorObject errorObject)
The error code should be one of the following:
invalid_redirect_uri
invalid_client_metadata
invalid_software_statement
unapproved_software_statement
To construct an exception for a general
invalid_client_metadata
error with a description:
new InvalidRegistrationException(RegistrationError.INVALID_CLIENT_METADATA .setDescription("The policy_uri must be on a redirect_uris domain"));
This will result in the following error response:
HTTP/1.1 400 Bad Request Content-Type: application/json Cache-Control: no-store Pragma: no-cache { "error" : "invalid_client_metadata", "error_description" : "The policy_uri must be on a redirect_uris domain" }
errorObject
- The associated error object. If null
will
be set to invalid_client_metadata
.public InvalidRegistrationException(String field, String cause)
invalid_client_metadata
and a description
specifying the name of the invalid field and cause.
Example:
new InvalidRegistrationException("policy_uri", "Must be on a redirect_uris domain");
This will result in the following error response:
HTTP/1.1 400 Bad Request Content-Type: application/json Cache-Control: no-store Pragma: no-cache { "error" : "invalid_client_metadata", "error_description" : "Invalid client metadata field policy_uri: Must be on a redirect_uris domain" }
field
- The name of the invalid client metadata field. Must not
be null
.cause
- The cause, null
if not specified.public com.nimbusds.oauth2.sdk.ErrorObject getErrorObject()
Copyright © 2021 Connect2id Ltd.. All rights reserved.