Modifying the Account Password Policy
Function
This API is used to modify the account password policy.
Authorization Information
Each account root user has all the permissions required to call all APIs, but IAM users must be assigned the following required identity policy-based permissions. For details about the required permissions, see Permissions Policies and Supported Actions.
| Action | Access Level | Resource Type (*: required) | Condition Key | Alias | Dependencies |
|---|---|---|---|---|---|
| iam:securitypolicies:updatePasswordPolicyV5 | Write | - | - | - | - |
URI
PUT /v5/password-policy
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| maximum_consecutive_identical_chars | No | Integer | Definition: The maximum number of times that a character is allowed to consecutively present in a password. Constraints: N/A Range: The value ranges from 0 to 32. Default Value: N/A |
| minimum_password_age | No | Integer | Definition: The minimum period (minutes) after which users are allowed to make a password change. Constraints: N/A Range: The value ranges from 0 to 1440. Default Value: N/A |
| minimum_password_length | No | Integer | Definition: The minimum number of characters that a password must contain. Constraints: N/A Range: The value ranges from 8 to 32. Default Value: N/A |
| password_reuse_prevention | No | Integer | Definition: The number of previously used passwords that are not allowed. Constraints: N/A Range: The value ranges from 0 to 24. Default Value: N/A |
| password_not_username_or_invert | No | Boolean | Definition Whether the password can be the username or the username spelled backwards. (This parameter has been discarded.) Constraints N/A Range The value can be true or false. Default Value The default value is true, indicating that the password cannot be the username or the username spelled backwards. |
| password_validity_period | No | Integer | Definition: Password validity period (days). Constraints: N/A Range: The value ranges from 0 to 180. Default Value: N/A |
| password_char_combination | No | Integer | Definition: Minimum number of character types that a password must contain. Constraints: N/A Range: The value ranges from 2 to 4. Default Value: N/A |
| allow_user_to_change_password | No | Boolean | Definition: Whether to allow IAM users to change their own passwords. Constraints: This parameter is not applicable to the root user. Range: N/A Default Value: N/A |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| password_policy | password_policy object | Definition: Password policy. Range: N/A |
| Parameter | Type | Description |
|---|---|---|
| maximum_consecutive_identical_chars | Integer | Definition: The maximum number of times that a character is allowed to consecutively present in a password. Range: N/A |
| maximum_password_length | Integer | Definition: Maximum number of characters that a password can contain. Range: N/A |
| minimum_password_age | Integer | Definition: The minimum period (minutes) after which users are allowed to make a password change. Range: N/A |
| minimum_password_length | Integer | Definition: The minimum number of characters that a password must contain. Range: N/A |
| password_reuse_prevention | Integer | Definition: The number of previously used passwords that are not allowed. Range: N/A |
| password_not_username_or_invert | Boolean | Definition: Whether the password can be the username or the username spelled backwards. The default value is true, indicating that the password cannot be the username or the username spelled backwards. Range: N/A |
| password_requirements | String | Definition: Characters that a password must contain. Range: N/A |
| password_validity_period | Integer | Definition: Password validity period (days). Range: N/A |
| password_char_combination | Integer | Definition: Minimum number of character types that a password must contain. Range: N/A |
| allow_user_to_change_password | Boolean | Definition: Whether to allow IAM users to change their own passwords. This parameter does not apply to the root user. Range: N/A |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Definition : Error code. For details, see Error Code. Range: The format is PAP5.XXXX, for example, PAP5.0012. |
| error_msg | String | Definition : Error message. For details, see Error Message. Range: N/A. |
| request_id | String | Definition: Unique identifier of an API request, which is used to locate API calling exceptions. Range: N/A |
Status code: 403
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Definition : Error code. For details, see Error Code. Range: The format is PAP5.XXXX, for example, PAP5.0012. |
| error_msg | String | Definition : Error message. For details, see Error Message. Range: N/A. |
| request_id | String | Definition: Unique identifier of an API request, which is used to locate API calling exceptions. Range: N/A |
| encoded_authorization_message | String | Definition : Encrypted details returned when the authentication fails, which are used to locate authentication problems. The STS5 decryption API can be used for decryption. For details, see API link. Range: N/A. |
Example Requests
Modifying the account password policy
PUT https://{endpoint}/v5/password-policy
{
"maximum_consecutive_identical_chars" : 0,
"minimum_password_age" : 0,
"minimum_password_length" : 8,
"password_reuse_prevention" : 1,
"password_validity_period" : 180,
"password_char_combination" : 2,
"allow_user_to_change_password" : true
} Example Responses
Status code: 200
Successful
{
"password_policy" : {
"maximum_consecutive_identical_chars" : 0,
"maximum_password_length" : 32,
"minimum_password_age" : 0,
"minimum_password_length" : 8,
"password_reuse_prevention" : 1,
"password_not_username_or_invert" : true,
"password_requirements" : "A password must contain at least two of the following: uppercase letters, lowercase letters, digits, and special characters.",
"password_validity_period" : 180,
"password_char_combination" : 2,
"allow_user_to_change_password" : true
}
} Status Codes
| Status Code | Description |
|---|---|
| 200 | Successful |
| 400 | Bad request |
| 403 | Forbidden |
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