- What's New
- Function Overview
- Service Overview
- Getting Started
-
User Guide
- Before You Start
- Logging In to Huawei Cloud
- IAM Users
- User Groups and Authorization
- Permissions Management
- Projects
- Agencies
- Security Settings
- Identity Providers
- Custom Identity Broker
- MFA Authentication and Virtual MFA Device
- Viewing IAM Operation Records
- Quotas
- Change History
-
API Reference
- Before You Start
- API Overview
- Calling APIs
- Getting Started
-
API
- Token Management
- Access Key Management
- Region Management
- Project Management
- Account Management
-
IAM User Management
- Listing IAM Users
- Querying IAM User Details (Recommended)
- Querying IAM User Details
- Querying the User Groups to Which an IAM User Belongs
- Querying the IAM Users in a Group
- Creating an IAM User (Recommended)
- Creating an IAM User
- Changing the Login Password
- Modifying IAM User Information (Recommended)
- Modifying IAM User Information (Recommended)
- Modifying User Information
- Deleting an IAM User
- User Group Management
-
Permissions Management
- Listing Permissions
- Querying Permission Details
- Querying Permissions Assignment Records
- Querying Permissions of a User Group for a Global Service Project
- Querying Permissions of a User Group for a Region-specific Project
- Granting Permissions to a User Group for a Global Service Project
- Granting Permissions to a User Group for a Region-specific Project
- Checking Whether a User Group Has Specified Permissions for a Global Service Project
- Checking Whether a User Group Has Specified Permissions for a Region-specific Project
- Querying All Permissions of a User Group
- Checking Whether a User Group Has Specified Permissions for All Projects
- Removing Specified Permissions of a User Group in All Projects
- Removing Permissions of a User Group for a Global Service Project
- Removing the Permissions of a User Group for a Region-specific Project
- Granting Permissions to a User Group for All Projects
- Custom Policy Management
-
Agency Management
- Listing Agencies
- Querying Agency Details
- Creating an Agency
- Modifying an Agency
- Deleting an Agency
- Querying Permissions of an Agency for a Global Service Project
- Querying Permissions of an Agency for a Region-specific Project
- Granting Permissions to an Agency for a Global Service Project
- Granting Permissions to an Agency for a Region-specific Project
- Checking Whether an Agency Has Specified Permissions for a Global Service Project
- Checking Whether an Agency Has Specified Permissions for a Region-specific Project
- Removing Permissions of an Agency for a Global Service Project
- Removing Permissions of an Agency for a Region-specific Project
- Querying All Permissions of an Agency
- Granting Specified Permissions to an Agency for All Projects
- Checking Whether an Agency Has Specified Permissions
- Removing Specified Permissions of an Agency in All Projects
-
Enterprise Project Management
- Querying User Groups Associated with an Enterprise Project
- Querying the Permissions of a User Group Associated with an Enterprise Project
- Granting Permissions to a User Group Associated with an Enterprise Project
- Removing Permissions of a User Group Associated with an Enterprise Project
- Querying the Enterprise Projects Associated with a User Group
- Querying the Enterprise Projects Directly Associated with an IAM User
- Querying Users Directly Associated with an Enterprise Project
- Querying Permissions of a User Directly Associated with an Enterprise Project
- Granting a User Permissions for an Enterprise Project
- Removing Permissions of a User Directly Associated with an Enterprise Project
- Granting Permissions to Agencies Associated with Specified Enterprise Projects
- Removing Permissions of Agencies Associated with Specified Enterprise Projects
-
Security Settings
- Modifying the Operation Protection Policy
- Querying the Operation Protection Policy
- Modifying the Password Policy
- Querying the Password Policy of an Account
- Modifying the Login Authentication Policy
- Querying the Login Authentication Policy
- Modifying the ACL for Console Access
- Querying the ACL for Console Access
- Modifying the ACL for API Access
- Querying the ACL for API Access
- Querying MFA Device Information of IAM Users
- Querying the MFA Device Information of an IAM User
- Querying Login Protection Configurations of IAM Users
- Querying the Login Protection Configuration of an IAM User
- Modifying the Login Protection Configuration of an IAM User
- Binding a Virtual MFA Device
- Unbinding a Virtual MFA Device
- Creating a Virtual MFA Device
- Deleting a Virtual MFA Device
-
Federated Identity Authentication Management
- Obtaining a Token Through Federated Identity Authentication
-
Identity Providers
- Listing Identity Providers
- Querying Identity Provider Details
- Creating an Identity Provider
- Modifying a SAML Identity Provider
- Deleting a SAML Identity Provider
- Creating an OpenID Connect Identity Provider Configuration
- Modifying an OpenID Connect Identity Provider
- Querying an OpenID Connect Identity Provider
- Mappings
- Protocols
- Metadata
- Token
- Listing Accounts Accessible to Federated Users
- Custom Identity Brokers
- Version Information Management
- Services and Endpoints
- Out-of-Date APIs
- Permissions and Actions
- Appendix
- Change History
- SDK Reference
- Best Practices
-
FAQs
- User Groups and Permissions Management
- IAM User Management
-
Security Settings
- How Do I Enable Login Verification?
- How Do I Disable Login Verification?
- How Do I Change the Verification Method for Performing Critical Operations?
- How Do I Disable Operation Protection?
- How Do I Bind a Virtual MFA Device?
- How Do I Obtain a Virtual MFA Verification Code?
- How Do I Unbind or Remove a Virtual MFA Device?
- Why Does MFA Authentication Fail?
- Why Am I Not Getting the Verification Code?
- Why Is My Account Locked?
- Why Doesn't My API Access Control Policy Take Effect?
- Why Do I Still Need to Perform MFA During Login After Unbinding the Virtual MFA Device?
-
Passwords and Credentials
- What Should I Do If I Forgot My Password?
- How Do I Change My Password?
- How Do I Obtain an Access Key (AK/SK)?
- What Should I Do If I Have Forgotten My Access Key (AK/SK)?
- What Are Temporary Security Credentials (AK/SK and Security Token)?
- How Do I Obtain a Token with Security Administrator Permissions?
- How Do I Obtain an Access Key (AK/SK) in the Cloud Alliance Regions?
- Project Management
- Agency Management
- Account Management
- Others
- Videos
How Do I Obtain a User Token Using Postman?
Postman is a visual editing tool for building and testing API requests. It provides an easy-to-use user interface to send HTTP requests, including GET, PUT, POST, and DELETE requests. Postman allows you to modify parameters of HTTP requests and returns response to your requests.
A token is a user's access credential, which includes user identities and permissions. When you call an API to access cloud resources, a token is required for identity authentication.
Perform the procedure described in this section to obtain a user token using Postman. For details about the parameters, see Obtaining a User Token.
- Validity period of a token
The validity period of a token is 24 hours. Cache your token to prevent frequent API calling. Ensure that the token is valid while you use it. Using a token that will soon expire may cause API calling failures.
Obtaining a new token does not affect the validity of the existing token. However, the following operations will invalidate the existing token:
- Deleting or disabling the IAM user
- Changing the IAM user's password or access key
- The IAM user's permissions are changed (due to outstanding payments, OBT application approval, or permission modification).
- Obtaining a token
- If your Huawei Cloud account has been upgraded to a HUAWEI ID, you cannot obtain a token using the HUAWEI ID. However, you can create an IAM user, grant the user required permissions, and obtain a token as the user.
- If you are a user of a third-party system, you cannot obtain a token by using the username and password that you use for federated identity authentication. Go to the Huawei Cloud login page, click Forgot password, click Reset Huawei Cloud account password, and set a password.
Prerequisites
You have installed and registered with Postman.
- You are advised to install a Postman version that supports a header larger than 32 KB. Otherwise, a header overflow error may be reported.
Procedure
- Edit the request URL, header, and body of the API used to obtain a token for calling APIs.
- Request URL
The request URL is in the format "https://IAM region and endpoint/API URI".
- Obtain the IAM region and endpoint.
- Obtain the API URI from Obtaining a User Token.
For example, the request URL in the eu-west-101 region is https://iam.myhuaweicloud.eu/v3/auth/tokens.
- Select an API request method and enter the request URL in Postman.
- Request Header
Set key to Content-Type and value to application/json;charset=utf8.
- Request Body
Modify parameters in the example request body.
{ "auth": { "identity": { "methods": [ "password" ], "password": { "user": { "domain": { "name": "Account name" }, "name": "IAM user name", "password": "IAM user password" } } }, "scope": { "domain": { "name": "Account name" } } } }
NOTE:
For details about how to obtain the account name and IAM user name, see Obtaining Account, IAM User, and Project Information.
- Request URL
- Click Send to send the API request.
- View the token in the response header. You can use this token for authentication when you call other IAM APIs.
NOTE:
- If error 401 is returned, the authentication has failed. Make sure that parameters in the request body are correct and send the request again.
- If error 400 is returned, the body format is incorrect. Check whether the body format complies with the JSON syntax. For details, see Status Codes.
- If "Header Overflow" is displayed, resolve the problem by referring to Why Am I Seeing a Message Indicating Header Overflow When I Attempt to Use Postman to Obtain a Token?
Why Am I Seeing a Message Indicating Header Overflow When I Attempt to Use Postman to Obtain a Token?
Postman of V7.25.0, V7.26.0, or a later version cannot be used to obtain a user token due to configurations. The message "Header Overflow" will be displayed if you use any of these versions.
- Solution 1
Use an earlier version of Postman, such as V 5.xx.
- Solution 2:
Use curl to obtain a token and replace the text in bold with actual values:
curl -ik -X POST -H 'Content-Type=application/json;charset=utf8' -d '{"auth": {"identity": {"methods": ["password"],"password": {"user": {"domain": {"name": "Account name"},"name": "IAM username","password": "IAM user password"}}},"scope": {"domain": {"name": "Account name"}}}}' https://iam.myhuaweicloud.eu/v3/auth/tokens
- Solution 3
Pass an additional environment variable NODE_OPTIONS=--max-http-header-size=16384 (16 KB) to Postman to specify the maximum size of the HTTP header (in bytes).
Run one of the following commands depending on your OS:
- macOS
NODE_OPTIONS=--max-http-header-size=16384 /Applications/Postman.app/Contents/MacOS/Postman
- Linux
NODE_OPTIONS=--max-http-header-size=16384 /path/to/Postman/Postman
- Windows
set NODE_OPTIONS=--max-http-header-size=16384 C:\users\<username>\AppData\local\Postman\Postman.exe
- macOS
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.