Logout from the application

I have followed the below and got into the application after okta authenticates.
https://developer.okta.com/docs/guides/implement-grant-type/authcode/main/

I have called /logout endpoint to manually logout from my application, it works fine.

When I am not doing anything (idle) in the application for X time, then i want to auto logout automatically.
Is there any option to configure in okta server for this? Please help.

your application will have to handle this logic for you (detecting when a user has been idle for X time) and trigger the /logout request, there’s nothing that will do this for you, short of the tokens expiring.

The application browser that left open yesterday evening was not closed, when I click on something in it redirected me to login page and relogin it worked fine. I am getting login page after some X time… but I do not know how long it is and how to change it.

How does that happen? where to do that in okta server? i am confused.

That’s likely because the user’s Okta session has expired, which means that the user will need to re-authenticate with Okta. By default, the Okta idle session lifetime is 2 hours and is configured in the user’s Sign On policy, so you may want to modify this: Okta Help Center (Lightning)

Note that the Okta session lifetime (based on a session cookie set on the Okta domain) is separate from the application session lifetime (based on OIDC tokens), but that an Okta session must be created in order make an /authorize call to get tokens, as discussed here. If you want to avoid interacting with the Okta session lifetime, refresh tokens can be used to extend an application session, regardless of the Okta sessions expiration.

1 Like

Thank you Andrea. I have configured Policy as its defined in the Okta Help Center (Lightning).
Also figured out how to do application time out as well (using session-config). When they both the values are in sync its bringing me to okta login page.

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