To manage passwords, execute requests using the "password-settings" API method (determine administrator token before executing the request):
Get password policy settings:
curl -v '<IP address or DNS server name>/api/v2/security/password-settings/' --header 'Content-Type: application/json' -H 'Authorization: Bearer <administrator token>'
The example of response:
{
"min_password_length": 5,
"is_both_register_in_password": true,
"is_digits_in_password": false,
"is_spec_chars_in_password": true,
"min_password_ttl": 15,
"max_password_ttl": 31,
"char_difference_with_old_password": 5,
"number_of_old_password": 2
}
Change password policy settings:
curl -X PUT -v '<IP address or DNS server name>/api/v2/security/password-settings/' --header 'Content-Type: application/json' -H 'Authorization: Bearer <administrator token>' -d '{
"min_password_length": <Minimum password length in characters>,
"is_both_register_in_password": <indicates whether password should contain letters of different case (true/false)>,
"is_digits_in_password": <indicates whether password should contain numbers (true/false)>,
"is_spec_chars_in_password": <indicates whether password should contain special characters (true/false)>,
"min_password_ttl": <minimum password validity period in days>,
"max_password_ttl": <maximum password validity period in days>,
"char_difference_with_old_password": <number of different characters in old and new password>,
"number_of_old_password": <number of new passwords that may match with previous ones>
}'
The example of response:
{
"min_password_length": 5,
"is_both_register_in_password": true,
"is_digits_in_password": false,
"is_spec_chars_in_password": true,
"min_password_ttl": 10,
"max_password_ttl": 15,
"char_difference_with_old_password": 5,
"number_of_old_password": 2
}
See also: