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
Copy file name to clipboardExpand all lines: content/operate/rs/references/rest-api/requests/users/authorize.md
+18-17Lines changed: 18 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,13 +13,13 @@ weight: $weight
13
13
14
14
| Method | Path | Description |
15
15
|--------|------|-------------|
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 |
17
17
18
18
## Authorize user {#post-authorize}
19
19
20
20
POST /v1/users/authorize
21
21
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.
23
23
24
24
### Request {#post-request}
25
25
@@ -29,12 +29,13 @@ Generate a JSON Web Token (JWT) for a user to use as authorization to access the
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
+
```
38
39
39
40
#### Request headers
40
41
| Key | Value | Description |
@@ -44,19 +45,19 @@ Generate a JSON Web Token (JWT) for a user to use as authorization to access the
44
45
45
46
#### Request body
46
47
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.
48
49
49
50
### Response {#post-response}
50
51
51
52
Returns a JSON object that contains the generated access token.
@@ -72,6 +73,6 @@ The following are possible `error_code` values:
72
73
73
74
| Code | Description |
74
75
|------|-------------|
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. |
0 commit comments