How to implement timer display before okta session expiry

Hi There,

I am trying to display a timer with count down alert right before 5minutes of OKTA session expiring. Is there any way that I can get something like getExpirationTime form tokenManager? or do you suggest any other approach for handling this?

Thank you,

Hey @leenakoorapati 2 ideas spring to mind to get the time:

  1. If you know how long the lifetime is for a session in your Okta org, you could start your own timer as soon as the user authenticates. Default session time is 2 hours.
  2. If you’re using OAuth/OpenID Connect you can check the iat (issued at) and exp (expires at) claims in your relevant tokens (which vary by flow) to calculate this.

How you actually would make the timer? That’s beyond me.

Thank you @abole for the ideas :slightly_smiling_face:

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