OWIN Authentication And Timeout

owin

Solution

Hope this will help someone to debug... The error is in web.config file

<system.webServer>
  <modules>
    <remove name="FormsAuthenticationModule" />
  </modules>
<system.webServer>

here the name Forms authenticationModule is a typo. it should be

<system.webServer>
  <modules>
    <remove name="FormsAuthentication" />
  </modules>
<system.webServer>

And voilla it started working.

Problem

I am using MVC 5 with OWIN Authentication. Here are the code for my StartUp.cs. ``` public void ConfigureAuth(IAppBuilder app) { app.UseCookieAuthentication(new CookieAuthenticationOptions { AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie, LoginPath = new PathString("/Account/Login"), ExpireTimeSpan = new TimeSpan(60000000000) }); app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie); } ``` The expiration time is set to 60000000000 nano seconds. Now the requirement is when the cookie is expired, I need to redirect to Login screen. How to do that?

Original source