You can sign out user from ASP.NET MVC application after your desired time of inactivity by using Azure Identity platform (Azure AD Authentication).
You can disable the token lifetime by giving UseTokenLifetime = false property in the startup class as below:
Session.Timeout = <value in mins>;
UseTokenLifetime = false,
ExpireTimeSpan = TimeSpan.FromMinutes(20);
Example:
app.UseOpenIdConnectAuthentication(new OpenIdConnectAuthenticationOptions
{
...
UseTokenLifetime = false,
...
});
- Try to change the session timeout value in web.config. For example, code in web.config under<system.web> namespace.
<sessionState timeout="<value in minutes>" />
Please check this Document for more information.