Obtaining a Token
Application Scenarios
If you use a token for authentication, you must obtain the token and add X-Auth-Token to the request header of the API when making a call.
Authenticating the Token
- Send POST https://IAM endpoint/v3/auth/tokens. Obtain the Identity and Access Management (IAM) endpoint and region name in the message body.
The following is an example request:
The italic words in the following example need to be replaced with the actual values. For details, see Obtaining a User Token.
{ "auth": { "identity": { "methods": [ "password" ], "password": { "user": { "name": "username", "password": "password", "domain": { "name": "domainname" } } } }, "scope": { "project": { "name": "aaa" } } } }
- Obtain the token. The token is the value of X-Subject-Token in the response.
- Call a service API, add X-Auth-Token to the request header, and set the value of X-Auth-Token to the token obtained in 2.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot