1

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":"xxxxx@gmail.com", "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.

1 Answers1

2

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

jernkuan
  • 630
  • 6
  • 8
  • Thank you for your reply. I went through the given link and you are right, we can configure this JWT Token expiry time manually in a configuration file after TB installation, how can we achieve this programatically? Do we need to run an external code, that will take input as time provided by Admin Users and update the configuration file? Is there a Thingsboard Native way? – bhimashankar poddar Jun 21 '21 at 02:52
  • Also in-case, if we want configure different JWT Token expiry time for different users, Is that possible? Any Ideas... – bhimashankar poddar Jun 21 '21 at 05:13