Quantcast
Channel: Security
Viewing all articles
Browse latest Browse all 4737

OWIN Authentication and timeout with redirection

$
0
0

Hi, 

I am using OWIN authentication with MVC 5. 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.

Basically I want to achieve the Forms authenitcation timeout feature with Microsoft.AspNet.Identity and OWIN.

How can I do that?


Viewing all articles
Browse latest Browse all 4737

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>