You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|[POST](#add-password)|`/v1/users/password`| Add a new password |
19
+
|[DELETE](#delete-password)|`/v1/users/password`| Delete a password |
20
20
21
21
## Update password {#update-password}
22
22
23
23
PUT /v1/users/password
24
24
25
-
Replaces the password list of the user making this request with a single new password. The request authentication header must include the relevant username and password.
25
+
Replaces the password list of the specified user with a single new password. If a `username` is not provided in the JSON request body, it replaces the password list of the authenticated user making this request instead.
26
26
27
27
### Request {#put-request}
28
28
@@ -34,6 +34,7 @@ Replaces the password list of the user making this request with a single new pas
34
34
35
35
```json
36
36
{
37
+
"username": "The username of the affected user. If missing, default to the authenticated user.",
37
38
"new_password": "the new (single) password"
38
39
}
39
40
```
@@ -50,6 +51,7 @@ The request must contain a JSON object with the following fields:
50
51
51
52
| Field | Type | Description |
52
53
|-------|------|-------------|
54
+
| username | string | (Optional) The username of the affected user. If missing, defaults to the authenticated user. |
53
55
| new_password | string | The new password (required) |
54
56
55
57
### Response {#put-response}
@@ -66,6 +68,8 @@ The following are possible `error_code` values:
66
68
|------|-------------|
67
69
| password_not_complex | The given password is not complex enough (Only work when the password_complexity feature is enabled). |
68
70
| new_password_same_as_current | The given new password is identical to one of the already existing passwords. |
71
+
| user_not_exist | User does not exist. |
72
+
| unauthorized_action | Updating another user's password is acceptable by an admin user only. |
69
73
70
74
### Status codes {#put-status-codes}
71
75
@@ -74,12 +78,14 @@ The following are possible `error_code` values:
|[404 Not Found](https://www.rfc-editor.org/rfc/rfc9110.html#name-404-not-found)| User not found. |
77
83
78
84
## Add password {#add-password}
79
85
80
86
POST /v1/users/password
81
87
82
-
Adds a new password to the password list of the user making this request. The request authentication header must include the relevant username and password.
88
+
Adds a new password to the specified user's password list. If a `username` is not provided in the JSON request body, it adds the password to the password list of the authenticated user making this request instead.
83
89
84
90
### Request {#post-request}
85
91
@@ -91,6 +97,7 @@ Adds a new password to the password list of the user making this request. The re
91
97
92
98
```json
93
99
{
100
+
"username": "The username of the affected user. If missing, default to the authenticated user.",
94
101
"new_password": "a password to add"
95
102
}
96
103
```
@@ -107,6 +114,7 @@ The request must contain a JSON object with the following fields:
107
114
108
115
| Field | Type | Description |
109
116
|-------|------|-------------|
117
+
| username | string | (Optional) The username of the affected user. If missing, defaults to the authenticated user. |
110
118
| new_password | string | New password to add (required) |
111
119
112
120
### Response {#post-response}
@@ -123,6 +131,8 @@ The following are possible `error_code` values:
123
131
|------|-------------|
124
132
| password_not_complex | The given password is not complex enough (Only work when the password_complexity feature is enabled). |
125
133
| new_password_same_as_current | The given new password is identical to one of the already existing passwords. |
134
+
| user_not_exist | User does not exist. |
135
+
| unauthorized_action | Updating another user's password is acceptable by an admin user only. |
126
136
127
137
### Status codes {#post-status-codes}
128
138
@@ -131,12 +141,14 @@ The following are possible `error_code` values:
131
141
|[200 OK](https://www.rfc-editor.org/rfc/rfc9110.html#name-200-ok)| Success, new password was added to the list of valid passwords. |
132
142
|[400 Bad Request](https://www.rfc-editor.org/rfc/rfc9110.html#name-400-bad-request)| Bad or missing parameters. |
133
143
|[401 Unauthorized](https://www.rfc-editor.org/rfc/rfc9110.html#name-401-unauthorized)| The user is unauthorized. |
|[404 Not Found](https://www.rfc-editor.org/rfc/rfc9110.html#name-404-not-found)| User not found. |
134
146
135
147
## Delete password {#delete-password}
136
148
137
149
DELETE /v1/users/password
138
150
139
-
Deletes a password from the password list of the user making this request. The request authentication header must include the relevant username and password.
151
+
Deletes a password from the specified user's password list. If a `username` is not provided in the JSON request body, it deletes the password from the password list of the authenticated user making this request instead.
140
152
141
153
### Request {#delete-request}
142
154
@@ -148,7 +160,8 @@ Deletes a password from the password list of the user making this request. The r
148
160
149
161
```json
150
162
{
151
-
"old_password": "an existing password"
163
+
"username": "The username of the affected user. If missing, default to the authenticated user.",
164
+
"old_password": "an existing password to delete"
152
165
}
153
166
```
154
167
@@ -164,6 +177,7 @@ The request must contain a JSON object with the following fields:
164
177
165
178
| Field | Type | Description |
166
179
|-------|------|-------------|
180
+
| username | string | (Optional) The username of the affected user. If missing, defaults to the authenticated user. |
167
181
| old_password | string | Existing password to be deleted (required) |
168
182
169
183
### Response {#delete-response}
@@ -176,7 +190,9 @@ The following are possible `error_code` values:
176
190
177
191
| Code | Description |
178
192
|------|-------------|
179
-
| cannot_delete_last_password | Cannot delete the last password of a user |
193
+
| cannot_delete_last_password | Cannot delete the last password of a user. |
194
+
| user_not_exist | User does not exist. |
195
+
| unauthorized_action | Updating another user's password is acceptable by an admin user only. |
180
196
181
197
### Status codes {#delete-status-codes}
182
198
@@ -185,3 +201,5 @@ The following are possible `error_code` values:
185
201
|[200 OK](https://www.rfc-editor.org/rfc/rfc9110.html#name-200-ok)| Success, new password was deleted from the list of valid passwords. |
186
202
|[400 Bad Request](https://www.rfc-editor.org/rfc/rfc9110.html#name-400-bad-request)| Bad or missing parameters. |
187
203
|[401 Unauthorized](https://www.rfc-editor.org/rfc/rfc9110.html#name-401-unauthorized)| The user is unauthorized. |
Copy file name to clipboardExpand all lines: content/operate/rs/7.8/security/access-control/manage-passwords/rotate-passwords.md
+19-10Lines changed: 19 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,37 +42,46 @@ The new password cannot already exist as a password for the user and must meet t
42
42
43
43
## Rotate password
44
44
45
-
To rotate your password:
45
+
To rotate passwords:
46
46
47
-
1. Add an additional password to your password list with [`POST /v1/users/password`]({{< relref "/operate/rs/7.8/references/rest-api/requests/users/password#add-password" >}}). You must provide the relevant username and current password for [basic authentication]({{<relref "/operate/rs/7.8/references/rest-api#authentication">}}) credentials when you send the request.
47
+
1. Add an additional password to a user's password list with [`POST /v1/users/password`]({{< relref "/operate/rs/7.8/references/rest-api/requests/users/password#add-password" >}}).
48
48
49
49
```sh
50
50
POST https://<host>:<port>/v1/users/password
51
-
{ "new_password": "<a_new_password>" }
51
+
{
52
+
"username": "<target_username>",
53
+
"new_password": "<a_new_password>"
54
+
}
52
55
```
53
56
54
-
After you send this request, you can authenticate with both the old and the new password.
57
+
After you send this request, the user can authenticate with both the old and the new password.
55
58
56
59
1. Update the password in all database connections that connect with the user account.
57
-
1. Delete the original password with [`DELETE /v1/users/password`]({{< relref "/operate/rs/7.8/references/rest-api/requests/users/password#update-password">}}):
60
+
1. Delete the original password with [`DELETE /v1/users/password`]({{< relref "/operate/rs/7.8/references/rest-api/requests/users/password#delete-password">}}):
58
61
59
62
```sh
60
63
DELETE https://<host>:<port>/v1/users/password
61
-
{ "old_password": "<an_existing_password>" }
64
+
{
65
+
"username": "<target_username>",
66
+
"old_password": "<existing_password_to_delete>"
67
+
}
62
68
```
63
69
64
70
If there is only one valid password for a user account, you cannot delete that password.
65
71
66
72
## Replace all passwords
67
73
68
-
You can also replace all existing passwords foryour user account with a single password that does not match any existing passwords.
74
+
You can also replace all existing passwords fora user account with a single password that does not match any existing passwords.
69
75
This can be helpful if you suspect that your passwords are compromised and you want to quickly resecure the account.
70
76
71
-
To replace your passwords, use [`PUT /v1/users/password`]({{< relref "/operate/rs/7.8/references/rest-api/requests/users/password#delete-password">}}). You must provide the relevant username and current password for [basic authentication]({{<relref "/operate/rs/7.8/references/rest-api#authentication">}}) credentials when you send the request.
77
+
To replace a user's passwords, use [`PUT /v1/users/password`]({{< relref "/operate/rs/7.8/references/rest-api/requests/users/password#update-password" >}}).
72
78
73
79
```sh
74
80
PUT https://<host>:<port>/v1/users/password
75
-
{ "new_password": "<a_new_password>" }
81
+
{
82
+
"username": "<target_username>",
83
+
"new_password": "<a_new_password>"
84
+
}
76
85
```
77
86
78
-
After this request, all of your existing passwords are deleted and only the new password is valid.
87
+
After this request, all of the user's existing passwords are deleted and only the new password is valid.
0 commit comments