GenerateTokenByAuthorizationServer

Updated at:

Generates an application authentication token through the instance-level authorization server token endpoint.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request syntax

POST /v2/{instanceId}/authorizationServer/{authorizationServerId}/oauth2/token HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

instanceId

string

Yes

The instance ID.

idaas_ue2jvisn35ea5lmthk267xxxxx

authorizationServerId

string

Yes

The authorization server ID.

iauths_system

Request parameters

Parameter

Type

Required

Description

Example

grant_type

string

Yes

The grant type.

authorization_code

client_id

string

Yes

The client ID.

app_mkv7rgt4d7i4u7zqtzev2mxxxx

code

string

No

The authorization code. Required when grant_type is set to authorization_code.

CO541xY59EsKniV2wvWDXZ4jiKxxxxx

username

string

No

The username.

userxxxxx

password

string

No

The user password.

testxxxxx

device_code

string

No

The device code. Required when grant_type is set to urn:ietf:params:oauth:grant-type:device_code.

DCxxxxxx

redirect_uri

string

No

The redirect URI. Required when grant_type is set to authorization_code. The value must be the same as the redirect URI specified in the authorization code request.

https://example.com/xxxxx

refresh_token

string

No

The refresh token.

RTxxxxx

scope

string

No

The scope.

openid

code_verifier

string

No

The code verifier.

dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk

client_assertion

string

No

The client assertion.

eyJraWQiOiJLRVlLZ0Iyxxxxx

client_assertion_type

string

No

The client assertion type.

urn:ietf:params:oauth:client-assertion-type:jwt-bearer

application_federated_credential_name

string

No

The application federated credential name.

testxxxxx

client_x509

string

No

The end-entity certificate.

testxxxxx

client_x509_chain

string

No

The intermediate certificate chain.

testxxxxx

client_secret

string

No

The client secret.

CSEHDcHcrUKHw1CuxkJEHPveWRxxxxx

Response elements

Element

Type

Description

Example

object

The token information.

token_type

string

The token type.

Bearer

access_token

string

The access token.

eyJraWQiOiJLRVlLZ0Iyxxxxx

refresh_token

string

The refresh token.

ATxxxxx

expires_in

integer

The validity period of the access token, in seconds.

1200

expires_at

integer

The expiration time of the access token. The value is a UNIX timestamp in seconds.

1653288641

id_token

string

The ID token.

eyJraWQiOiJLRVlLZ0Iyxxxxx

scope

string

The scope.

openid

Examples

Success response

JSON format

{
  "token_type": "Bearer",
  "access_token": "eyJraWQiOiJLRVlLZ0Iyxxxxx\n",
  "refresh_token": "ATxxxxx",
  "expires_in": 1200,
  "expires_at": 1653288641,
  "id_token": "eyJraWQiOiJLRVlLZ0Iyxxxxx\n",
  "scope": "openid"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.