Step 23: Get the access token
POST {{authPath}}/{{destinationEnvID}}/as/token
Call the token endpoint to obtain an access token by using a POST {{authPath}}/{{destinationEnvID}}/as/token
request. The token endpoint is used by the client to obtain an access token by presenting its authorization grant. For authorization_code grants
, the application calls the POST /{{destinationEnvID}}/as/token
endpoint to acquire the access token.
The request body must include values for the following properties:
grant_type
A string that specifies the grant type of the token request. In this example, the value is authorization_code
.
code
A string that specifies the authorization code value returned by the authorization request.
redirect_uri
A string that specifies the URL that specifies the return entry point of the application. In the request body:
The response data contains the access token and the ID token.
For more information, see Token (authorization_code).
Request Body
[{"name"=>"grant_type", "value"=>"authorization_code", "datatype"=>"string"}, {"name"=>"code", "value"=>"{{authCode}}", "datatype"=>"string"}, {"name"=>"redirect_uri", "value"=>"https://example.com", "datatype"=>"string"}, {"name"=>"scope", "value"=>"openid profile", "datatype"=>"string"}]
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Authorization | string | ||
Content-Type | string |