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
RS: Authentication header is required for /users/password API (#1598)
* Copied fixes for outdated password rotation and authorize user docs to RS 7.8 version
* DOC-5270 RS: Authentication header is required for /users/password API
|[POST](#post-authorize)|`/v1/users/authorize`|Authorize a user |
17
+
|[POST](#post-authorize)|`/v1/users/authorize`|Generate a token to authorize an authenticated user |
18
18
19
19
## Authorize user {#post-authorize}
20
20
21
21
POST /v1/users/authorize
22
22
23
-
Generate a JSON Web Token (JWT) for a user to use as authorization to access the REST API.
23
+
Generates a JSON Web Token (JWT) for a user to use as authorization to access the REST API. The request authentication header must include the relevant username and password.
24
24
25
25
### Request {#post-request}
26
26
@@ -30,12 +30,13 @@ Generate a JSON Web Token (JWT) for a user to use as authorization to access the
30
30
31
31
#### Example JSON body
32
32
33
-
```json
34
-
{
35
-
"username": "user@redislabs.com",
36
-
"password": "my_password"
37
-
}
38
-
```
33
+
The request body is optional unless you want to specify the token's time to live:
34
+
35
+
```json
36
+
{
37
+
"ttl": <time_in_seconds>
38
+
}
39
+
```
39
40
40
41
#### Request headers
41
42
| Key | Value | Description |
@@ -45,19 +46,19 @@ Generate a JSON Web Token (JWT) for a user to use as authorization to access the
45
46
46
47
#### Request body
47
48
48
-
Include a [JWT authorize object]({{< relref "/operate/rs/7.8/references/rest-api/objects/jwt_authorize" >}}) with a valid username and password in the request body.
49
+
Optionally include a JSON object in the request body to specify the time to live (`ttl`), which determines the amount of time in seconds the token will be valid. The default `ttl` is `300` seconds. The minimum `ttl` is `1` second and the maximum `ttl` is `86400` seconds.
49
50
50
51
### Response {#post-response}
51
52
52
53
Returns a JSON object that contains the generated access token.
@@ -73,6 +74,6 @@ The following are possible `error_code` values:
73
74
74
75
| Code | Description |
75
76
|------|-------------|
76
-
|[200 OK](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1)| The user is authorized. |
77
-
|[400 Bad Request](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1)| The request could not be understood by the server due to malformed syntax. |
78
-
|[401 Unauthorized](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2)| The user is unauthorized. |
77
+
|[200 OK](https://www.rfc-editor.org/rfc/rfc9110.html#name-200-ok)| The user is authorized. |
78
+
|[400 Bad Request](https://www.rfc-editor.org/rfc/rfc9110.html#name-400-bad-request)| The request could not be understood by the server due to malformed syntax. |
79
+
|[401 Unauthorized](https://www.rfc-editor.org/rfc/rfc9110.html#name-401-unauthorized)| The user is unauthorized. |
|[PUT](#update-password)|`/v1/users/password`|Change an existing password |
18
-
|[POST](#add-password)|`/v1/users/password`| Add a new password |
19
-
|[DELETE](#delete-password)|`/v1/users/password`| Delete a password |
17
+
|[PUT](#update-password)|`/v1/users/password`|Replace the password of the authenticated user|
18
+
|[POST](#add-password)|`/v1/users/password`| Add a new password for the authenticated user|
19
+
|[DELETE](#delete-password)|`/v1/users/password`| Delete a password for the authenticated user|
20
20
21
21
## Update password {#update-password}
22
22
23
23
PUT /v1/users/password
24
24
25
-
Reset the password list of an internal user to include a new password.
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.
26
26
27
27
### Request {#put-request}
28
28
@@ -34,8 +34,6 @@ Reset the password list of an internal user to include a new password.
34
34
35
35
```json
36
36
{
37
-
"username": "johnsmith",
38
-
"old_password": "a password that exists in the current list",
39
37
"new_password": "the new (single) password"
40
38
}
41
39
```
@@ -48,12 +46,10 @@ Reset the password list of an internal user to include a new password.
48
46
49
47
#### Request body
50
48
51
-
The request must contain a single JSON object with the following fields:
49
+
The request must contain a JSON object with the following fields:
52
50
53
51
| Field | Type | Description |
54
52
|-------|------|-------------|
55
-
| username | string | Affected user (required) |
56
-
| old_password | string | A password that exists in the current list (required) |
57
53
| new_password | string | The new password (required) |
58
54
59
55
### Response {#put-response}
@@ -75,16 +71,15 @@ The following are possible `error_code` values:
|[400 Bad Request](https://www.rfc-editor.org/rfc/rfc9110.html#name-400-bad-request)| Bad or missing parameters. |
76
+
|[401 Unauthorized](https://www.rfc-editor.org/rfc/rfc9110.html#name-401-unauthorized)| The user is unauthorized. |
82
77
83
78
## Add password {#add-password}
84
79
85
80
POST /v1/users/password
86
81
87
-
Add a new password to an internal user's passwords list.
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
83
89
84
### Request {#post-request}
90
85
@@ -96,8 +91,6 @@ Add a new password to an internal user's passwords list.
96
91
97
92
```json
98
93
{
99
-
"username": "johnsmith",
100
-
"old_password": "an existing password",
101
94
"new_password": "a password to add"
102
95
}
103
96
```
@@ -110,13 +103,11 @@ Add a new password to an internal user's passwords list.
110
103
111
104
#### Request body
112
105
113
-
The request must contain a single JSON object with the following fields:
106
+
The request must contain a JSON object with the following fields:
114
107
115
108
| Field | Type | Description |
116
109
|-------|------|-------------|
117
-
| username | string | Affected user (required) |
118
-
| old_password | string | A password that exists in the current list (required) |
119
-
| new_password | string | The new (single) password (required) |
110
+
| new_password | string | New password to add (required) |
120
111
121
112
### Response {#post-response}
122
113
@@ -137,15 +128,15 @@ The following are possible `error_code` values:
137
128
138
129
| Code | Description |
139
130
|------|-------------|
140
-
|[200 OK](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1)| Success, new password was added to the list of valid passwords. |
141
-
|[400 Bad Request](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1)| Bad or missing parameters. |
142
-
|[401 Unauthorized](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2)| The user is unauthorized. |
143
-
|[404 Not Found](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5)| Attempting to add a password to a non-existing user. |
131
+
|[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
+
|[400 Bad Request](https://www.rfc-editor.org/rfc/rfc9110.html#name-400-bad-request)| Bad or missing parameters. |
133
+
|[401 Unauthorized](https://www.rfc-editor.org/rfc/rfc9110.html#name-401-unauthorized)| The user is unauthorized. |
144
134
145
135
## Delete password {#delete-password}
136
+
146
137
DELETE /v1/users/password
147
138
148
-
Delete a password from an internal user's passwords list.
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.
149
140
150
141
### Request {#delete-request}
151
142
@@ -157,7 +148,6 @@ Delete a password from an internal user's passwords list.
157
148
158
149
```json
159
150
{
160
-
"username": "johnsmith",
161
151
"old_password": "an existing password"
162
152
}
163
153
```
@@ -170,11 +160,10 @@ Delete a password from an internal user's passwords list.
170
160
171
161
#### Request body
172
162
173
-
The request must contain a single JSON with the following fields:
163
+
The request must contain a JSON object with the following fields:
174
164
175
165
| Field | Type | Description |
176
166
|-------|------|-------------|
177
-
| username | string | Affected user (required) |
178
167
| old_password | string | Existing password to be deleted (required) |
179
168
180
169
### Response {#delete-response}
@@ -193,7 +182,6 @@ The following are possible `error_code` values:
193
182
194
183
| Code | Description |
195
184
|------|-------------|
196
-
|[200 OK](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1)| Success, new password was deleted from the list of valid passwords. |
197
-
|[400 Bad Request](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1)| Bad or missing parameters. |
198
-
|[401 Unauthorized](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2)| The user is unauthorized. |
199
-
|[404 Not Found](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5)| Attempting to delete a password to a non-existing user. |
185
+
|[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
+
|[400 Bad Request](https://www.rfc-editor.org/rfc/rfc9110.html#name-400-bad-request)| Bad or missing parameters. |
187
+
|[401 Unauthorized](https://www.rfc-editor.org/rfc/rfc9110.html#name-401-unauthorized)| The user is unauthorized. |
Redis Enterprise Software lets you implement password rotation policies using the [REST API]({{< relref "/operate/rs/7.8/references/rest-api" >}}).
16
16
17
-
You can add a new password for a database user without immediately invalidating the old one (which might cause authentication errors in production).
17
+
You can add a new password for a database user without immediately invalidating the old one to prevent possible authentication errors in production.
18
18
19
19
{{< note >}}
20
20
Password rotation does not work for the default user. [Add additional users]({{< relref "/operate/rs/7.8/security/access-control/create-users" >}}) to enable password rotation.
@@ -28,7 +28,7 @@ you can set a [password expiration policy]({{< relref "/operate/rs/7.8/security/
28
28
However, for database connections that rely on password authentication,
29
29
you need to allow for authentication with the existing password while you roll out the new password to your systems.
30
30
31
-
With the Redis Enterprise Software REST API, you can add additional passwords to a user account for authentication to the database or the Cluster Manager UI and API.
31
+
With the Redis Enterprise Software REST API, you can add additional passwords to your user account for authentication to the database or the Cluster Manager UI and API.
32
32
33
33
After the old password is replaced in the database connections, you can delete the old password to finish the password rotation process.
34
34
@@ -42,13 +42,13 @@ 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 the password of a user account:
45
+
To rotate your password:
46
46
47
-
1. Add an additional password to a user account with [`POST /v1/users/password`]({{< relref "/operate/rs/7.8/references/rest-api/requests/users/password#add-password" >}}):
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.
After you send this request, you can authenticate with both the old and the new password.
@@ -57,26 +57,22 @@ To rotate the password of a user account:
57
57
1. Delete the original password with [`DELETE /v1/users/password`]({{< relref "/operate/rs/7.8/references/rest-api/requests/users/password#update-password">}}):
If there is only one valid password for a user account, you cannot delete that password.
65
65
66
66
## Replace all passwords
67
67
68
-
You can also replace all existing passwords fora user account with a single password that does not match any existing passwords.
68
+
You can also replace all existing passwords foryour user account with a single password that does not match any existing passwords.
69
69
This can be helpful if you suspect that your passwords are compromised and you want to quickly resecure the account.
70
70
71
-
To replace all existing passwordsfor a user account with a single new password, use [`PUT /v1/users/password`]({{< relref "/operate/rs/7.8/references/rest-api/requests/users/password#delete-password">}}):
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.
Copy file name to clipboardExpand all lines: content/operate/rs/references/rest-api/requests/users/password.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ weight: $weight
21
21
22
22
PUT /v1/users/password
23
23
24
-
Replaces the password list of the user making this request with a single new password.
24
+
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
25
26
26
### Request {#put-request}
27
27
@@ -78,7 +78,7 @@ The following are possible `error_code` values:
78
78
79
79
POST /v1/users/password
80
80
81
-
Adds a new password to the password list of the user making this request.
81
+
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.
82
82
83
83
### Request {#post-request}
84
84
@@ -135,7 +135,7 @@ The following are possible `error_code` values:
135
135
136
136
DELETE /v1/users/password
137
137
138
-
Deletes a password from the password list of the user making this request.
138
+
Deletes a password from the password list of the user making this request. The request authentication header must include the relevant username and password.
0 commit comments