How can I make the authToken last longer than a day before expiring?

Options
Hello,

I have this issue where after a day of inactivity, the authToken generated upon sign-in expires, making all the authenticated APIs return empty values with HTTP 401 error messages like this:

{"code":"ERROR_CODE_UNAUTHORIZED","message":"The token expired."}.

I've set up caching on my auth/me API to 7 days (which seems to be the max) but the token still expires after about a day of inactivity.

I have attached a screenshot of my auth/me settings below in case someone can help point out what I'm not doing well. Thank you.

[image.png]

Comments

  • Steve Stava
    Steve Stava Member
    Options
    You will want to change the "expiration" parameter in the "Create Authentication Token" for the auth/login and auth/signup APIs. The expiration parameter controls the length of time in seconds that the token will remain valid.

    By default it is set to 86,400 seconds (60 sec X 60 min X 24 hrs = 86,400 seconds in a day). If you take 86,400 times 7 you will get the number of seconds in a week and that is how long your token on signup or login will remain valid.
  • Eben
    Eben Member
    Options
    Thank you so much, Steve!