Updated on 2024-04-10 GMT+08:00

Registering a Client

Function

This API is used to register a client in IAM Identity Center, which allows the client to initiate device authorization. The output should be persistent for reuse by authentication requests.

URI

POST /v1/clients

Request Parameters

Table 1 Parameters in the request body

Parameter

Mandatory

Type

Description

client_name

Yes

String

Client name

Minimum length: 1

Maximum length: 1024

client_type

Yes

String

Client type. Only the public client is supported.

Enumerated value:

  • public

token_endpoint_auth_method

Yes

String

Authentication method required to send a request to the token endpoint

Enumerated value:

  • client_secret_post

scopes

No

Array of strings

List of scopes defined by a client to restrict permissions for access token authorization

grant_types

Yes

Array of strings

OAuth2.0 authorization type that a client can use at the token endpoint

Enumerated value:

  • urn:ietf:params:oauth:grant-type:device_code
  • authorization_code

response_types

Yes

Array of strings

OAuth2.0 authorization type that a client can use at the authorization endpoint

Enumerated value:

  • code

Response Parameters

Status code: 200

Table 2 Parameters in the response body

Parameter

Type

Description

client_info

Object

Client registration information

Table 3 client_info

Parameter

Type

Description

authorization_endpoint

String

Authorization endpoint requested from a client

client_id

String

Unique ID of a client application

client_id_issued_at

Long

Registration time of the client ID and secret key

client_secret

String

Secret string generated for the client to obtain authorization from services in subsequent calls

client_secret_expires_at

Long

Expiration time of the client ID and secret key

token_endpoint

String

Endpoint from which a client can obtain an access token

scopes

Array of strings

List of registered scopes for subsequent authorization of access tokens for a client

Example Request

Registering a client in IAM Identity Center

POST https://{hostname}/v1/clients

{
  "client_name" : "exampleClient",
  "client_type" : "public",
  "token_endpoint_auth_method" : "client_secret_post",
  "scopes" : [ "openid" ],
  "grant_types" : [ "authorization_code", "urn:ietf:params:oauth:grant-type:device_code"],
  "response_types" : [ "code" ]
}

Example Response

Status code: 200

Successful

{
  "client_info" : {
    "authorization_endpoint" : "https://example-region-oidc.examplehh.com:443/v1/authorize",
    "client_id" : "example_client_id",
    "client_id_issued_at" : 1677175760,
    "client_secret" : "example_client_secret",
    "client_secret_expires_at" : 1684951760,
    "token_endpoint" : "https://example-region-oidc.examplehh.com:443/v1/tokens",
    "scopes" : [ "openid" ]
  }
}

Status Codes

For details, see Status Codes.

Error Codes

For details, see Error Codes.