Search code examples
jwtthingsboard

Thingsboard : How to retrieve JWT Token and define expiry time?


I am just studying the Thingsboard IoT platform features. And we know that to retrieve JWT Token for a user, we should POST following API command,

curl -X POST --header "Content-Type: application/json" --header "Accept: application/json" -d "{"username":"[email protected]", "password":"xxxxxx"}" "https://thingsboard.cloud/api/auth/login"

The timeout for this JWT token is set to "9000" sec by default.

How can we modify this Token expiry time?

Your help would be appreciated.

Thank you.


Solution

  • This should be configured as part of security.jwt.tokenExpirationTime

    https://thingsboard.io/docs/user-guide/install/config/

    You should probably need to use the refresh token to keep your session logged in via /auth/token