Generates a token for accessing an application in an instance.
Operation description
- The following authorization types are supported: authorization code, device code, refresh token, and client credentials.
Debugging
Authorization information
Request syntax
POST /v2/{instanceId}/{applicationId}/oauth2/token
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
instanceId | string | Yes | The instance ID. | idaas_ue2jvisn35ea5lmthk267xxxxx |
applicationId | string | Yes | The application ID. | app_mkv7rgt4d7i4u7zqtzev2mxxxx |
client_id | string | No | The client ID. | app_mkv7rgt4d7i4u7zqtzev2mxxxx |
client_secret | string | No | The client secret. This parameter is required if grant_type is set to client_credentials. | CSEHDcHcrUKHw1CuxkJEHPveWRXBGqVqRsxxxx |
grant_type | string | Yes | The authorization type. Valid values:
| client_credentials |
code | string | No | The authorization code. This parameter is required if grant_type is set to authorization_code. | xxxx |
username | string | No | The username. This parameter is required if grant_type is set to password. The password authentication type is not supported. | uesrname_001 |
password | string | No | The username. This parameter is required if grant_type is set to password. The password authentication type is not supported. | xxxxxx |
device_code | string | No | The device code. This parameter is required if grant_type is set to authorization_code.urn:ietf:params:oauth:grant-type:device_code. | xxxx |
redirect_uri | string | No | The redirect URI. This parameter is required if grant_type is set to authorization_code. The value of this parameter must be the same as the redirect URI in the request to obtain the authorization code. | xxx |
refresh_token | string | No | The refreshed token. This parameter is required if grant_type is set to refresh_token. | ATxxx |
code_verifier | string | No | The verification code. | xxx |
exclusive_tag | string | No | The excluded tags. | ATxxx |
scope | string | No | The authorization scope. Valid values:
| xxxx |
Response parameters
Examples
Sample success responses
JSON
format
{
"token_type": "Bearer",
"access_token": "ATxxx",
"refresh_token": "RTxxx",
"expires_in": 1200,
"expires_at": 1653288641,
"id_token": "xxxxx"
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2023-10-24 | The internal configuration of the API is changed, but the call is not affected | View Change Details |
2023-04-04 | The internal configuration of the API is changed, but the call is not affected | View Change Details |