简体   繁体   中英

When utilizing IBM hpc-cluster api, how do I authenticate with IAM Token?

JSON response when trying to make an API call. I keep getting "IAM Token passed is invalid."

{
  "error": {
    "message": "IAM Token passed is invalid.",
    "transaction_id": "257a01a1-cfa2-4fbf-b6bc-5abd1fd820f7"
  },
  "success": false
}

Make sure to renew your IAM Token and not use any previous or someone else's token to make a call.

Following are the CLI commands to follow to log into IBM cloud and generate a new IAM token.

ibmcloud login
ibmcloud iam oauth-tokens

Doc link: https://console.bluemix.net/docs/services/cloud-monitoring/security/auth_iam.html#auth_iam

To work with the API, the user should add IBM Cloud IAM access token in the API request authentication header:

-H 'Authorization: Bearer <IAM_TOKEN>'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM