How do I generate the "com.ibm.cloud.iam.Identity.prod" cookie?

132 Views Asked by At

When logged in to IBM Cloud, you'll get com.ibm.cloud.iam.Identity.prod in the cookie.

Using IAM, how do I get this cookie generated? It seems like it is neither access_token nor uaa_token.

Thanks!

1

There are 1 best solutions below

0
On

The cookie is technically a urn:ibm:params:oauth:grant-type:iam-cookie. You can exchange the cookie for an access token...

curl -X POST \ https://iam.cloud.ibm.com/identity/token \ -H 'Authorization: Basic Yng6Yng=' \ -H 'Content-Type: application/x-www-form-urlencoded' \ -d 'grant_type=urn%3Aibm%3Aparams%3Aoauth%3Agrant-type%3Aiam-cookie&response_type=cloud_iam&cookie=xxxxxx'

Where xxxxxx is the cookie.