Dynamic Client Registration

Register Client

Register a client. This API is supposed to be used to implement a client registration endpoint that complies with RFC 7591 (OAuth 2.0 Dynamic Client Registration Protocol).

Description

This API is supposed to be called from the within the implementation of the client registration endpoint of the authorization server. The authorization server implementation should retrieve the value of action from the response and take the following steps according to the value. INTERNAL_SERVER_ERROR When the value of action is INTERNAL\_SERVER\_ERROR, it means that the API call from the authorization server implementation was wrong or that an error occurred in Authlete. In either case, from a viewpoint of the client or developer, it is an error on the server side. Therefore, the authorization server implementation should generate a response with "500 Internal Server Error"s and application/json. The value of responseContent is a JSON string which describes the error, so it can be used as the entity body of the response. The following illustrates the response which the authorization server implementation should generate and return to the client or developer.

HTTP/1.1 500 Internal Server Error
Content-Type: application/json
Cache-Control: no-store
Pragma: no-cache
{responseContent}

The endpoint implementation may return another different response to the client or developer since "500 Internal Server Error" is not required by the specification. BAD_REQUEST When the value of action is BAD\_REQUEST, it means that the request from the client or developer was wrong. The authorization server implementation should generate a response with "400 Bad Request" and application/json. The value of responseContent is a JSON string which describes the error, so it can be used as the entity body of the response. The following illustrates the response which the authorization server implementation should generate and return to the client or developer.

HTTP/1.1 400 Bad Request
Content-Type: application/json
Cache-Control: no-store
Pragma: no-cache
{responseContent}

CREATED When the value of action is CREATED, it means that the request from the client or developer is valid. The authorization server implementation should generate a response to the client or developer with "201 CREATED" and application/json. The responseContent a JSON string which can be used as the entity body of the response. The following illustrates the response which the authorization server implementation should generate and return to the client or developer.

HTTP/1.1 201 CREATED
Content-Type: application/json
Cache-Control: no-store
Pragma: no-cache
{responseContent}
post/api/{serviceId}/client/registration

Path parameters

serviceIdstring required

A service ID.

Request body

jsonstring required

Client metadata in JSON format that complies with RFC 7591 (OAuth 2.0 Dynamic Client Registration Protocol).

tokenstring

The client registration access token. Used only for GET, UPDATE, and DELETE requests.

clientIdstring

The client's identifier. Used for GET, UPDATE, and DELETE requests

Response

Client registration completed successfully

resultCodestring

The code which represents the result of the API call.

resultMessagestring

A short message which explains the result of the API call.

action'BAD_REQUEST' | 'CREATED' | 'DELETED' | 'INTERNAL_SERVER_ERROR' | 'OK' | 'UNAUTHORIZED' | 'UPDATED'

The next action that the authorization server implementation should take.

responseContentstring

The content that the authorization server implementation is to return to the client application. Its format varies depending on the value of action parameter.

Example response

{
  "client": {
    "number": 1140735077,
    "serviceNumber": 715948317,
    "clientName": "My Test Client",
    "clientId": "1140735077",
    "clientSecret": "gXz97ISgLs4HuXwOZWch8GEmgL4YMvUJwu3er_kDVVGcA0UOhA9avLPbEmoeZdagi9yC_-tEiT2BdRyH9dbrQQ",
    "clientType": "PUBLIC",
    "redirectUris": [
      "https://example.com/callback"
    ],
    "responseTypes": [
      "CODE"
    ],
    "grantTypes": [
      "AUTHORIZATION_CODE"
    ]
  }
}

Changes