MethodPathDescription
POST/v1/users/authorizeAuthorize a user

Authorize user

POST /v1/users/authorize

Generate a JSON Web Token (JWT) for a user to use as authorization to access the REST API.

Request

Example HTTP request

POST /users/authorize

Example JSON body

{
    "username": "user@redislabs.com",
    "password": "my_password"
}

Request headers

KeyValueDescription
Hostcnm.cluster.fqdnDomain name
Acceptapplication/jsonAccepted media type

Request body

Include a JWT authorize object with a valid username and password in the request body.

Response

Returns a JSON object that contains the generated access token.

Example JSON body

{
    "access_token": "eyJ5bGciOiKIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXViOjE0NjU0NzU0ODYsInVpZFI1IjEiLCJleHAiOjE0NjU0Nz30OTZ9.2xYXumd1rDoE0edFzcLElMOHsshaqQk2HUNgdsUKxMU"
}

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:

CodeDescription
password_expiredThe password has expired and must be changed.

Status codes

CodeDescription
200 OKThe user is authorized.
400 Bad RequestThe request could not be understood by the server due to malformed syntax.
401 UnauthorizedThe user is unauthorized.