When auth 0 automatically logout user I want to show popup before that

Ready to post? :mag: First, try searching for your answer.
Hi,

I want to show a popup before user automatically logout by autho when the session is over.

form popup I want to extend the session on the extend button click.

In this, please refer below timing

ID Token Expiration:1200 seconds

Absolute Lifetime: 2592000 seconds

Inactivity Lifetime:1296000 seconds

I am using anguler and auth0/auth0-angular": “^2.2.3”

Also, I want to know from this ID Token Expiration, Absolute Lifetime, and Inactivity Lifetime Which is responsible for the user’s automatic logout

Hi @suraj.parmar, and sorry for the late reply.

To achieve what you have described, your flow should be something similar to:

  1. After the user logs in, decode the ID Token to access the exp claim that contains the token’s lifetime in milliseconds.
  2. Calculate a duration that is a few minutes (depends on your requirements) shorter than the token’s lifetime.
  3. Create your pop-up and a function that opens it using the setTimeout() method of the Window interface.
  4. In your pop-up, create a button that makes a request for a Silent Authentication to renew the session.

To answer your second question, the Inactivity Lifetime is responsible for logging out an idle user. However, this cannot be accessed directly in code, as it is an attribute managed by the Auth0 server.

The flow I have provided previously can be used by setting the Idle Session Lifetime in your Auth0 Dashboard to a value slightly higher than the ID Token expiration (exp claim). This ensures that the user is prompted to extend their session right before both Lifetimes expire, resulting in the user taking an action on your client (extending the Inactivity Lifetime) and allowing the user to continue making authorized calls to your protected endpoints.

Please let me know if there is anything else you would like to know!

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