How Do I Obtain a Token?
A token specifies temporary permissions in a computer system. During API authentication using a token, the token is added to request headers to get permissions for calling the API.
The following uses the cn-south-1 region as an example to describe how to use Postman to obtain a user token. Postman 7.24.0 is recommended.
- The POST request URL is https://iam.cn-south-1.myhuaweicloud.com/v3/auth/tokens. You do not need to set Headers.
- The body format is as follows:
{
"auth": {
"identity": {
"methods": [
"password"
],
"password": {
"user": {
"name": "Username",
"password": "Account password",
"domain": {
"name": "Account name"
}
}
}
},
"scope": {
"project": {
"name": "Region where FRS is deployed, for example, cn-south-1"
}
}
}
} - After the request is sent, if the return code is 201, click Header to obtain the value of X-Subject-Token, which is the token.
To call an API in another region, you need to use the IAM address of the region to obtain the token and then call the API in the region.
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.