I am creating a webapp that uses passport.js to connect to Azure AD, and several other User Directory services. I am wanting to remain signed in for several days at a time, and not need to click sign in every 15 minutes.
Using azure as an example With this SSO verification: My site 'www.webapp.com' redirects the user to signs on at 'b2c.azure.com'. I get a callback containing the user from 'b2c.azure.com' . The user now has 1 session on 'b2c.azure.com' and another session on 'www.webapp.com'.
azure.com will be configured with it's own session timeout, say 30 minutes.
webapp.com can implement it's own session timeouts, say 2 days.
If 45 minutes after authenticating, the user is removed from azure.com They will remain active on 'www.webapp.com' for another 1 day, 23 hours and 15 minutes.
www.webapp.com could forward the user to the sign in on azure every 10 minutes, to see if the user is authenticated, but that means:
- The app is 'restricted' by azures session time, it can not be longer
- It is inefficient as has to regularly send the user to azure.com to re-sign in, sending them away from The app.
- There is a poor user experience of constantly signing in.
How do webapps manage to :
- Have longer session times than the directory service they support & so not require regular sign in
- Not provide service to users who have been removed from the directory service
p.s. I know in theory session time should be 15 minutes - 30 minutes for security reasons, but I don't want to disrupt the user experience to re-sign in every 15-30 minutes.