latestOpenAPI 3.1.0Apache License Version 2.02026-08-17498525913.3 KB

40169ccdec5c

login-endpoint

Login method to get user JWT token data

Login method used to authenticate user and get JWT token data.

Value of the response token field can be used as X-Authorization header value:

X-Authorization: Bearer $JWT_TOKEN_VALUE.

post/api/auth/login

Request body

usernamestring required

User email

passwordstring required

User password

Example request

{
  "username": "tenant@thingsboard.org",
  "password": "tenant"
}

Response

OK

tokenstring required

JWT token

refreshTokenstring required

Refresh token

Example response

{
  "token": "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZW5hbnRAdGhpbmdzYm9hcmQub3JnIi...",
  "refreshToken": "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZW5hbnRAdGhpbmdzYm9hcmQub3JnIi..."
}