Obtaining a Token
A token is an access credential issued to an IAM user to bear the user's identity and permissions. The validity period of a token is 24 hours. Cache the token to prevent frequent API calling. The original token will be valid till it expires regardless of whether a new token has been obtained. Ensure that the token is valid when you use it. Using a token that will soon expire may cause API calling failures. You can obtain a token using any of the following methods:
Using Cloud CLI
cloud IAM KeystoneCreateUserTokenByPassword --cli-region=${regionName} --auth.identity.methods.1="password" --auth.identity.password.user.name=${IAM user name} --auth.identity.password.user.password=${IAM user password} --auth.identity.password.user.domain.name=${Name of the account to which the IAM user belongs} --auth.scope.domain.name=${Name of the account to which the IAM user belongs} --cli-output=tsv --cli-query="response_header.X-Subject-Token[0]" If the invocation is successful, the returned result is a token.
What is your overall rating for this page?
Thank 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