Class InvalidRegistrationException

java.lang.Object
java.lang.Throwable
java.lang.Exception
com.nimbusds.openid.connect.provider.spi.reg.InvalidRegistrationException
All Implemented Interfaces:
Serializable

Invalid client registration exception.
See Also:
  • Constructor Details

    • InvalidRegistrationException

      Creates a new invalid client registration exception with a general 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"
       }
       
    • InvalidRegistrationException

      public InvalidRegistrationException(@Nullable com.nimbusds.oauth2.sdk.ErrorObject errorObject)
      Creates a new invalid client registration exception with the specified error code and description.

      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"
       }
       
      Parameters:
      errorObject - The associated error object. If null will be set to invalid_client_metadata.
    • InvalidRegistrationException

      public InvalidRegistrationException(String field, @Nullable 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.

      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"
       }
       
      Parameters:
      field - The name of the invalid client metadata field. Must not be null.
      cause - The cause, null if not specified.
  • Method Details

    • getErrorObject

      public com.nimbusds.oauth2.sdk.ErrorObject getErrorObject()
      Returns the associated error object.
      Returns:
      The associated error object.