4.2.3 Generate the Access Token

To generate the Access Token, add the Client ID, Client Secret, User Name, and Password using cURL Commands in the CLI Tool. The following is an example:

echo -n "<tenant_oauth_app_client_id>:<tenant_oauth_app_client_secret>" | base64 -w 0      (generates basic base64 encoded authorization token)

curl -H "Authorization: Basic <base64 encoded tenant_oauth_app_client_id:tenant_oauth_app_client_secret>"

 -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8"  --request POST

https://<idcs-URL.identity>.<TENANT>.com/oauth2/v1/token

 -d "grant_type=password&scope=urn:opc:idm:__myscopes__&username=<username>&password=<password>"

echo -n "<PROD_APP_ID_INTERNAL>" | base64 -w 0

curl -H "Authorization: Basic <Basic_Auth_Token>

 -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8"  --request POST

https://<idcs-URL.identity.TENANT.com/oauth2/v1/token

 -d "grant_type=password&scope=urn:opc:idm:__myscopes__&username=<UserName>&password=<Password>"

After generating the Access Token, invoke the API as shown in the following section.