Reputation: 127
I successully using azure ad account to login my app with openid connect , but my user will logout after 1 hour. I haven't find code to set the session expire time in my code , any document explain that? Any how could i extend the session active time?
Upvotes: 2
Views: 2549
Reputation: 27538
I haven't find code to set the session expire time in my code , any document explain that?
Please refer to this link :http://www.cloudidentity.com/blog/2016/07/25/controlling-a-web-apps-session-duration-2/
By default, in ASP.NET 4.6 the amount of time for which this session is matches the validity timeframe of the token that prompted the generation of the session in the first place. Say that you are using the OIDC MW with Azure AD: the id_token received by the app during the user authentication transaction will last one hour, hence the session cookie for your app will also last 1 hour.
To extend the duration of your session , you could add a hidden iframe in the web app, which hits the new “forced” sign in route at regular time intervals , please refer to the code sample in above aritcle .
Upvotes: 0
Reputation: 58931
You can configurable token lifetimes in Azure Active Directory using some PowerShell cmdlets from the AzureAD module.
Upvotes: 2