用户密码请求
用户密码请求
Redis 企业软件 |
---|
方法 | 路径 | 描述 |
---|---|---|
放 | /v1/users/password |
更改现有密码 |
发布 | /v1/users/password |
添加新密码 |
删除 | /v1/users/password |
删除密码 |
更新密码
PUT /v1/users/password
重置内部用户的密码列表以包含新密码。
请求
HTTP 请求示例
PUT /v1/users/password
示例 JSON 正文
{
"username": "johnsmith",
"old_password": "a password that exists in the current list",
"new_password": "the new (single) password"
}
Request headers
Key
Value
Description
Host
cnm.cluster.fqdn
Domain name
Accept
application/json
Accepted media type
Request body
The request must contain a single JSON object with the following fields:
Field
Type
Description
username
string
Affected user (required)
old_password
string
A password that exists in the current list (required)
new_password
string
The new password (required)
Response
Returns a status code to indicate password update success or failure.
Error codes
When errors are reported, the server may return a JSON object with
error_code
and message
fields that provide additional information.
The following are possible error_code
values:
Code
Description
password_not_complex
The given password is not complex enough (Only work when the password_complexity feature is enabled).
new_password_same_as_current
The given new password is identical to one of the already existing passwords.
Status codes
Code
Description
200 OK
Success, password changed
400 Bad Request
Bad or missing parameters.
401 Unauthorized
The user is unauthorized.
404 Not Found
Attempting to reset password to a non-existing user.
Add password
POST /v1/users/password
Add a new password to an internal user's passwords list.
Request
Example HTTP request
POST /v1/users/password
Example JSON body
{
"username": "johnsmith",
"old_password": "an existing password",
"new_password": "a password to add"
}
Request headers
Key
Value
Description
Host
cnm.cluster.fqdn
Domain name
Accept
application/json
Accepted media type
Request body
The request must contain a single JSON object with the following fields:
Field
Type
Description
username
string
Affected user (required)
old_password
string
A password that exists in the current list (required)
new_password
string
The new (single) password (required)
Response
Returns a status code to indicate password creation success or failure. If an error occurs, the response body may include a more specific error code and message.
Error codes
When errors are reported, the server may return a JSON object with
error_code
and message
fields that provide additional information.
The following are possible error_code
values:
Code
Description
password_not_complex
The given password is not complex enough (Only work when the password_complexity feature is enabled).
new_password_same_as_current
The given new password is identical to one of the already existing passwords.
Status codes
Code
Description
200 OK
Success, new password was added to the list of valid passwords.
400 Bad Request
Bad or missing parameters.
401 Unauthorized
The user is unauthorized.
404 Not Found
Attempting to add a password to a non-existing user.
Delete password
DELETE /v1/users/password
Delete a password from an internal user's passwords list.
Request
Example HTTP request
DELETE /v1/users/password
Example JSON body
{
"username": "johnsmith",
"old_password": "an existing password"
}
Request headers
Key
Value
Description
Host
cnm.cluster.fqdn
Domain name
Accept
application/json
Accepted media type
Request body
The request must contain a single JSON with the following fields:
Field
Type
Description
username
string
Affected user (required)
old_password
string
Existing password to be deleted (required)
Response
Error codes
When errors are reported, the server may return a JSON object with
error_code
and message
fields that provide additional information.
The following are possible error_code
values:
Code
Description
cannot_delete_last_password
Cannot delete the last password of a user
Status codes
Code
Description
200 OK
Success, new password was deleted from the list of valid passwords.
400 Bad Request
Bad or missing parameters.
401 Unauthorized
The user is unauthorized.
404 Not Found
Attempting to delete a password to a non-existing user.
On this page