Get idle token lifetime from token

Please include the following information in your post:

  • **Which SDK this is regarding: auth0-angular
  • **SDK Version:1.8.2
  • **Platform Version: Angular 12

I need to get the idle token lifetime so I can Inform the user there is x amounts of minutes left for the user to perform an action otherwise it will be logged out

Hi there @GFlores and welcome to the community!

Depending on your use case, both ID and Access tokens have an exp claim which is a Unix timestamp for when each respective token will expire. You could do some math with this time vs the current time. Alternatively, if you are requesting both an ID and Access token (openid scope) there will be an expires_in value included in the response alongside the tokens. This value refers to the lifetime of the Access token specifically and is in seconds.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.