Querying the Token Policy of an Account
Function
This API is used to query the token policy of an account. The token policy controls whether tokens can be obtained for IAM users, agencies, and federated users under the account. (Unscoped tokens obtained through federated authentication are not affected).
Authorization Information
No identity policy-based permission required for calling this API.
URI
GET /v5/token-policy
Request Parameters
None
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
token_policy |
TokenPolicy object |
Token policy of an account. |
|
Parameter |
Type |
Description |
|---|---|---|
|
token_enabled |
Boolean |
Whether obtaining tokens is allowed. The default value is true. Setting this parameter to false forbids token obtaining for IAM users, agencies, and federated users under the account. (Unscoped tokens obtained through federated authentication are not affected.) |
Status code: 403
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code. |
|
error_msg |
String |
Error message. |
|
request_id |
String |
Request ID. |
|
encoded_authorization_message |
String |
Encrypted authentication failure information, which can be decrypted using the STS5 decryption API. |
Example Requests
Querying the token policy of an account
GET https://{endpoint}/v5/token-policy
Example Responses
Status code: 200
Request succeeded.
{
"token_policy" : {
"token_enabled" : true
}
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Request succeeded. |
|
403 |
Insufficient permissions. |
Error Codes
See Error Codes.
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