Requesting the Access Token
To generate a token from IDCS, the following information is needed:
-
IDCS URL
-
Client Id and Client Secret
-
OAuth Scope
The curl command below invokes an IDCS service to generate an access token:
curl -I -H 'Authorization: Basic <base64Encoded OAuth_Clientid:Secret>' -H 'Content-Type: application/x-www-form-urlencoded;charset=UTF-8' --request POST <IDCS_URL>/oauth2/v1/token -d 'grant_type=client_credentials&scope=rgbu:pom:services-customer-administrator-<ENV_ID>'
This is a standard ReST call, with the following specifics:
-
<IDCS URL> is the IDCS URL of this instance.
-
<base64Encoded OAuth_Clientid:Secret> is the Base64-encoded OAuth Client Id and Client Secret provided as a Basic Authentication header.
-
Specify the body as:
grant_type=client_credentials&scope=
rgbu:pom:services-customer-administrator-<ENV_ID>
The response to this call will be in this format:
{
"access_token": "<TOKEN>",
"token_type": "Bearer",
"expires_in": 3600
}