IDCS Client/Confidential application and OAuth token to access IDCS API

In this article, I am going to cover how to create a client app that can be use to IDCS API authentication, and how to use client ID and secret to generate bearer token.

Client Application

In Integrated applications, add a Confidential Application as below




Select Client credentials for Authorization and add app roles required for the API (note: if app roles are not added, we will see access denied error for some API like enabling attributes for import.)

Once the application is created, activate it.

Bearer Token Generation

Next step, I will provide two options to generate bearer token based on client ID and Client secret.

Option#1: cURL

curl -i -H "Authorization: Basic <base64encoded clientid:clientsecret>" -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST https://IDCSURL/oauth2/v1/token -d "grant_type=client_credentials&scope=urn:opc:idm:__myscopes__"

Option#2: GitHub URL import to Postman

Set the Environment Parameters in Postman with GitHub URL import

Import the Postman Collection and Global Variables with GitHub URL import

You can refer to Oracle document for the imports mentioned above -

https://www.oracle.com/webfolder/technetwork/tutorials/obe/cloud/idcs/idcs_rest_postman_obe/rest_postman.html#RegisteraClientApplication

Use Bearer Token to Call IDCS APIs

With the Bearer token generated above, we can use it to call IDCS APIs.





Till next time.
Adam

Comments

Popular posts from this blog