
707ex (707ex) asked a question.
I'd like to display a modal to a user who's been inactive indicating that their session will expire in X number of minutes (and give them the option to logout/extend the session). I previously accomplished this using the expireEarlySeconds attribute in the TokenManager, but in more recent versions of okta-auth-js expireEarlySeconds is a development only attribute, so that's no longer working. Is there a recommended way to accomplish this?

Just to add, I'm using Typescript/React with okta-react 6.7.0 and okta-auth-js 7.2.0
Hello @707ex (707ex) Thank you for reacting out to our Community!
I was able to find this similar question on the developer forum that might provide some inside on this issue:
https://devforum.okta.com/t/how-to-implement-session-timeout-alert/10136
Additionally if you need further assistance we recommend to leverage the Okta Developer forums for this type of questions and take advantage of their expertise.
https://devforum.okta.com/
Community members help others by clicking Like or Select as Best on responses. Try it today.
💡 Community Moderator Tip: Join a group today and connect with other Okta customers by region or product.
Hi Paul, thanks for sharing that. The original poster's question is exactly what we're trying to accomplish, but none of the responses actually answered his question. Even his own response is a little ambiguous. I'm hoping you can clarify Okta's intended way for these tokens to be used.
To reiterate, what we're trying to do is display a countdown modal to the user letting them know how much time is left in their session. We currently have the access token set to expire ~5 minutes and 30 seconds before the id token. When the access token expires, we use an event handler for the expire event to display the countdown modal (which should display the time remaining in the id token). The user can then either choose to logout or renew the access token and continue with their session. Can you confirm if this is in line with Okta's recommendations?
That aside though, there are still 2 big discrepancies between the settings in our dashboard and the behavior we're seeing. I've already confirmed that the user/group being tested are all correct.
Any light you can shed on these issues would be greatly appreciated.