Skip to content

Commit cc9dfb1

Browse files
authored
RS: Fixed outdated password rotation and authorize user docs (#1564)
* DOC-5248 RS: Fixed outdated password rotation docs * Added breaking changes for /users/password and /users/authorize APIs to 7.8 release notes * DOC-5248 Feedback update to add 401 status codes back to API reference * Updated 401 status code links * Fixed /users/authorize breaking change description * Removed redundant wording * Fixed /users/authorize breaking change description on 7.8 release notes index * Updated outdated /users/authorize REST API reference * Added ttl default, min, and max values to /users/authorize API reference * Fixed another error in /users/authorize breaking changes description
1 parent bbcf000 commit cc9dfb1

File tree

5 files changed

+87
-66
lines changed

5 files changed

+87
-66
lines changed

content/operate/rs/references/rest-api/requests/users/authorize.md

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ weight: $weight
1313

1414
| Method | Path | Description |
1515
|--------|------|-------------|
16-
| [POST](#post-authorize) | `/v1/users/authorize` | Authorize a user |
16+
| [POST](#post-authorize) | `/v1/users/authorize` | Generate a token to authorize an authenticated user |
1717

1818
## Authorize user {#post-authorize}
1919

2020
POST /v1/users/authorize
2121

22-
Generate a JSON Web Token (JWT) for a user to use as authorization to access the REST API.
22+
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.
2323

2424
### Request {#post-request}
2525

@@ -29,12 +29,13 @@ Generate a JSON Web Token (JWT) for a user to use as authorization to access the
2929

3030
#### Example JSON body
3131

32-
```json
33-
{
34-
"username": "[email protected]",
35-
"password": "my_password"
36-
}
37-
```
32+
The request body is optional unless you want to specify the token's time to live:
33+
34+
```json
35+
{
36+
"ttl": <time_in_seconds>
37+
}
38+
```
3839

3940
#### Request headers
4041
| Key | Value | Description |
@@ -44,19 +45,19 @@ Generate a JSON Web Token (JWT) for a user to use as authorization to access the
4445

4546
#### Request body
4647

47-
Include a [JWT authorize object]({{< relref "/operate/rs/references/rest-api/objects/jwt_authorize" >}}) with a valid username and password in the request body.
48+
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.
4849

4950
### Response {#post-response}
5051

5152
Returns a JSON object that contains the generated access token.
5253

5354
#### Example JSON body
5455

55-
```json
56-
{
57-
"access_token": "eyJ5bGciOiKIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXViOjE0NjU0NzU0ODYsInVpZFI1IjEiLCJleHAiOjE0NjU0Nz30OTZ9.2xYXumd1rDoE0edFzcLElMOHsshaqQk2HUNgdsUKxMU"
58-
}
59-
```
56+
```json
57+
{
58+
"access_token": "eyJ5bGciOiKIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXViOjE0NjU0..."
59+
}
60+
```
6061

6162
### Error codes {#post-error-codes}
6263

@@ -72,6 +73,6 @@ The following are possible `error_code` values:
7273

7374
| Code | Description |
7475
|------|-------------|
75-
| [200 OK](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1) | The user is authorized. |
76-
| [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. |
77-
| [401 Unauthorized](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2) | The user is unauthorized. |
76+
| [200 OK](https://www.rfc-editor.org/rfc/rfc9110.html#name-200-ok) | The user is authorized. |
77+
| [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. |
78+
| [401 Unauthorized](https://www.rfc-editor.org/rfc/rfc9110.html#name-401-unauthorized) | The user is unauthorized. |

content/operate/rs/references/rest-api/requests/users/password.md

Lines changed: 20 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ weight: $weight
1313

1414
| Method | Path | Description |
1515
|----------------------------|----------------------|-----------------------------|
16-
| [PUT](#update-password) | `/v1/users/password` | Change an existing password |
17-
| [POST](#add-password) | `/v1/users/password` | Add a new password |
18-
| [DELETE](#delete-password) | `/v1/users/password` | Delete a password |
16+
| [PUT](#update-password) | `/v1/users/password` | Replace the password of the authenticated user |
17+
| [POST](#add-password) | `/v1/users/password` | Add a new password for the authenticated user |
18+
| [DELETE](#delete-password) | `/v1/users/password` | Delete a password for the authenticated user |
1919

2020
## Update password {#update-password}
2121

2222
PUT /v1/users/password
2323

24-
Reset the password list of an internal user to include a new password.
24+
Replaces the password list of the user making this request with a single new password.
2525

2626
### Request {#put-request}
2727

@@ -33,8 +33,6 @@ Reset the password list of an internal user to include a new password.
3333

3434
```json
3535
{
36-
"username": "johnsmith",
37-
"old_password": "a password that exists in the current list",
3836
"new_password": "the new (single) password"
3937
}
4038
```
@@ -47,12 +45,10 @@ Reset the password list of an internal user to include a new password.
4745

4846
#### Request body
4947

50-
The request must contain a single JSON object with the following fields:
48+
The request must contain a JSON object with the following fields:
5149

5250
| Field | Type | Description |
5351
|-------|------|-------------|
54-
| username | string | Affected user (required) |
55-
| old_password | string | A password that exists in the current list (required) |
5652
| new_password | string | The new password (required) |
5753

5854
### Response {#put-response}
@@ -74,16 +70,15 @@ The following are possible `error_code` values:
7470

7571
| Code | Description |
7672
|------|-------------|
77-
| [200 OK](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1) | Success, password changed |
78-
| [400 Bad Request](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1) | Bad or missing parameters. |
79-
| [401 Unauthorized](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2) | The user is unauthorized. |
80-
| [404 Not Found](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5) | Attempting to reset password to a non-existing user. |
73+
| [200 OK](https://www.rfc-editor.org/rfc/rfc9110.html#name-200-ok) | Success, password changed. |
74+
| [400 Bad Request](https://www.rfc-editor.org/rfc/rfc9110.html#name-400-bad-request) | Bad or missing parameters. |
75+
| [401 Unauthorized](https://www.rfc-editor.org/rfc/rfc9110.html#name-401-unauthorized) | The user is unauthorized. |
8176

8277
## Add password {#add-password}
8378

8479
POST /v1/users/password
8580

86-
Add a new password to an internal user's passwords list.
81+
Adds a new password to the password list of the user making this request.
8782

8883
### Request {#post-request}
8984

@@ -95,8 +90,6 @@ Add a new password to an internal user's passwords list.
9590

9691
```json
9792
{
98-
"username": "johnsmith",
99-
"old_password": "an existing password",
10093
"new_password": "a password to add"
10194
}
10295
```
@@ -109,13 +102,11 @@ Add a new password to an internal user's passwords list.
109102

110103
#### Request body
111104

112-
The request must contain a single JSON object with the following fields:
105+
The request must contain a JSON object with the following fields:
113106

114107
| Field | Type | Description |
115108
|-------|------|-------------|
116-
| username | string | Affected user (required) |
117-
| old_password | string | A password that exists in the current list (required) |
118-
| new_password | string | The new (single) password (required) |
109+
| new_password | string | New password to add (required) |
119110

120111
### Response {#post-response}
121112

@@ -136,15 +127,15 @@ The following are possible `error_code` values:
136127

137128
| Code | Description |
138129
|------|-------------|
139-
| [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. |
140-
| [400 Bad Request](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1) | Bad or missing parameters. |
141-
| [401 Unauthorized](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2) | The user is unauthorized. |
142-
| [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. |
130+
| [200 OK](https://www.rfc-editor.org/rfc/rfc9110.html#name-200-ok) | Success, new password was added to the list of valid passwords. |
131+
| [400 Bad Request](https://www.rfc-editor.org/rfc/rfc9110.html#name-400-bad-request) | Bad or missing parameters. |
132+
| [401 Unauthorized](https://www.rfc-editor.org/rfc/rfc9110.html#name-401-unauthorized) | The user is unauthorized. |
143133

144134
## Delete password {#delete-password}
135+
145136
DELETE /v1/users/password
146137

147-
Delete a password from an internal user's passwords list.
138+
Deletes a password from the password list of the user making this request.
148139

149140
### Request {#delete-request}
150141

@@ -156,7 +147,6 @@ Delete a password from an internal user's passwords list.
156147

157148
```json
158149
{
159-
"username": "johnsmith",
160150
"old_password": "an existing password"
161151
}
162152
```
@@ -169,11 +159,10 @@ Delete a password from an internal user's passwords list.
169159

170160
#### Request body
171161

172-
The request must contain a single JSON with the following fields:
162+
The request must contain a JSON object with the following fields:
173163

174164
| Field | Type | Description |
175165
|-------|------|-------------|
176-
| username | string | Affected user (required) |
177166
| old_password | string | Existing password to be deleted (required) |
178167

179168
### Response {#delete-response}
@@ -192,7 +181,6 @@ The following are possible `error_code` values:
192181

193182
| Code | Description |
194183
|------|-------------|
195-
| [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. |
196-
| [400 Bad Request](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1) | Bad or missing parameters. |
197-
| [401 Unauthorized](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2) | The user is unauthorized. |
198-
| [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. |
184+
| [200 OK](https://www.rfc-editor.org/rfc/rfc9110.html#name-200-ok) | Success, new password was deleted from the list of valid passwords. |
185+
| [400 Bad Request](https://www.rfc-editor.org/rfc/rfc9110.html#name-400-bad-request) | Bad or missing parameters. |
186+
| [401 Unauthorized](https://www.rfc-editor.org/rfc/rfc9110.html#name-401-unauthorized) | The user is unauthorized. |

content/operate/rs/release-notes/rs-7-8-releases/_index.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,24 @@ Redis Software version 7.8.2 introduces the following breaking changes:
6565

6666
- When you [upgrade a database]({{<relref "/operate/rs/references/rest-api/requests/bdbs/upgrade#post-bdbs-upgrade">}}) using the REST API, you can set `"latest_with_modules": false` in the request body to prevent module upgrades.
6767

68+
- Authentication method changes for [`/v1/users/password`]({{<relref "/operate/rs/references/rest-api/requests/users/password">}}) REST API requests.
69+
70+
- `PUT`, `POST`, and `DELETE` methods require users to include their usernames and a current password in the authentication header to change their password lists. If the authentication header is not provided, the response status will be `401 Unauthorized`.
71+
72+
- `/v1/users/password` requests change the password list of the user who provides their credentials in the authorization header when sending the requests.
73+
74+
- `PUT` and `POST` requests will ignore `username` and `old_password` parameters provided in the request body.
75+
76+
- `DELETE` requests will ignore the `username` parameter provided in the request body.
77+
78+
- Authentication method changes for [`POST /v1/users/authorize`]({{<relref "/operate/rs/references/rest-api/requests/users/authorize">}}) REST API requests.
79+
80+
- The `POST` method requires users to include their usernames and a current password in the authentication header to generate a JSON Web Token.
81+
82+
- `POST /v1/users/authorize` generates a token for the user who provides their credentials in the authorization header when sending the requests.
83+
84+
- `POST` requests will ignore `username` and `password` parameters provided in the request body.
85+
6886
#### Redis database version 7.4 breaking changes {#redis-74-breaking-changes}
6987

7088
When new major versions of Redis Community Edition change existing commands, upgrading your database to a new version can potentially break some functionality. Before you upgrade, read the provided list of breaking changes that affect Redis Software and update any applications that connect to your database to handle these changes.

content/operate/rs/release-notes/rs-7-8-releases/rs-7-8-2-34.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,24 @@ Redis Software version 7.8.2 introduces the following breaking changes:
246246

247247
- When you [upgrade a database]({{<relref "/operate/rs/references/rest-api/requests/bdbs/upgrade#post-bdbs-upgrade">}}) using the REST API, you can set `"latest_with_modules": false` in the request body to prevent module upgrades.
248248

249+
- Authentication method changes for [`/v1/users/password`]({{<relref "/operate/rs/references/rest-api/requests/users/password">}}) REST API requests.
250+
251+
- `PUT`, `POST`, and `DELETE` methods require users to include their usernames and a current password in the authentication header to change their password lists. If the authentication header is not provided, the response status will be `401 Unauthorized`.
252+
253+
- `/v1/users/password` requests change the password list of the user who provides their credentials in the authorization header when sending the requests.
254+
255+
- `PUT` and `POST` requests will ignore `username` and `old_password` parameters provided in the request body.
256+
257+
- `DELETE` requests will ignore the `username` parameter provided in the request body.
258+
259+
- Authentication method changes for [`POST /v1/users/authorize`]({{<relref "/operate/rs/references/rest-api/requests/users/authorize">}}) REST API requests.
260+
261+
- The `POST` method requires users to include their usernames and a current password in the authentication header to generate a JSON Web Token.
262+
263+
- `POST /v1/users/authorize` generates a token for the user who provides their credentials in the authorization header when sending the requests.
264+
265+
- `POST` requests will ignore `username` and `password` parameters provided in the request body.
266+
249267
### Redis database version 7.4 breaking changes {#redis-74-breaking-changes}
250268

251269
When new major versions of Redis Community Edition change existing commands, upgrading your database to a new version can potentially break some functionality. Before you upgrade, read the provided list of breaking changes that affect Redis Software and update any applications that connect to your database to handle these changes.

content/operate/rs/security/access-control/manage-passwords/rotate-passwords.md

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ weight: 70
1313

1414
Redis Enterprise Software lets you implement password rotation policies using the [REST API]({{< relref "/operate/rs/references/rest-api" >}}).
1515

16-
You can add a new password for a database user without immediately invalidating the old one (which might cause authentication errors in production).
16+
You can add a new password for a database user without immediately invalidating the old one to prevent possible authentication errors in production.
1717

1818
{{< note >}}
1919
Password rotation does not work for the default user. [Add additional users]({{< relref "/operate/rs/security/access-control/create-users" >}}) to enable password rotation.
@@ -27,7 +27,7 @@ you can set a [password expiration policy]({{< relref "/operate/rs/security/acce
2727
However, for database connections that rely on password authentication,
2828
you need to allow for authentication with the existing password while you roll out the new password to your systems.
2929

30-
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.
30+
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.
3131

3232
After the old password is replaced in the database connections, you can delete the old password to finish the password rotation process.
3333

@@ -41,13 +41,13 @@ The new password cannot already exist as a password for the user and must meet t
4141

4242
## Rotate password
4343

44-
To rotate the password of a user account:
44+
To rotate your password:
4545

46-
1. Add an additional password to a user account with [`POST /v1/users/password`]({{< relref "/operate/rs/references/rest-api/requests/users/password#add-password" >}}):
46+
1. Add an additional password to your password list with [`POST /v1/users/password`]({{< relref "/operate/rs/references/rest-api/requests/users/password#add-password" >}}). You must provide the relevant username and current password for [basic authentication]({{<relref "/operate/rs/references/rest-api#authentication">}}) credentials when you send the request.
4747

4848
```sh
49-
POST https://[host][:port]/v1/users/password
50-
'{"username":"<username>", "old_password":"<an_existing_password>", "new_password":"<a_new_password>"}'
49+
POST https://<host>:<port>/v1/users/password
50+
{ "new_password": "<a_new_password>" }
5151
```
5252
5353
After you send this request, you can authenticate with both the old and the new password.
@@ -56,26 +56,22 @@ To rotate the password of a user account:
5656
1. Delete the original password with [`DELETE /v1/users/password`]({{< relref "/operate/rs/references/rest-api/requests/users/password#update-password" >}}):
5757
5858
```sh
59-
DELETE https://[host][:port]/v1/users/password
60-
'{"username":"<username>", "old_password":"<an_existing_password>"}'
59+
DELETE https://<host>:<port>/v1/users/password
60+
{ "old_password": "<an_existing_password>" }
6161
```
6262
6363
If there is only one valid password for a user account, you cannot delete that password.
6464
6565
## Replace all passwords
6666
67-
You can also replace all existing passwords for a user account with a single password that does not match any existing passwords.
67+
You can also replace all existing passwords for your user account with a single password that does not match any existing passwords.
6868
This can be helpful if you suspect that your passwords are compromised and you want to quickly resecure the account.
6969
70-
To replace all existing passwords for a user account with a single new password, use [`PUT /v1/users/password`]({{< relref "/operate/rs/references/rest-api/requests/users/password#delete-password" >}}):
70+
To replace your passwords, use [`PUT /v1/users/password`]({{< relref "/operate/rs/references/rest-api/requests/users/password#delete-password" >}}). You must provide the relevant username and current password for [basic authentication]({{<relref "/operate/rs/references/rest-api#authentication">}}) credentials when you send the request.
7171
7272
```sh
73-
PUT https://[host][:port]/v1/users/password
74-
'{"username":"<username>", "old_password":"<an_existing_password>", "new_password":"<a_new_password>"}'
73+
PUT https://<host>:<port>/v1/users/password
74+
{ "new_password": "<a_new_password>" }
7575
```
7676
77-
All of the existing passwords are deleted and only the new password is valid.
78-
79-
{{<note>}}
80-
If you send the above request without specifying it is a `PUT` request, the new password is added to the list of existing passwords.
81-
{{</note>}}
77+
After this request, all of your existing passwords are deleted and only the new password is valid.

0 commit comments

Comments
 (0)