0
huntethan89 created
Hi, we have ADFS enabled in our project but it is not mandatory. Some users login via application credentials while some uses AD user account to login. However, when session expires, all users redirect to ADFS login page. How can we handle this scenario and have users always redirect to /Account/Login when session timeouts.
Startup.cs code looks like this:
int ExpireFromDays = 1;
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
LoginPath = new PathString("/Account/Login"),
SlidingExpiration = true,
ExpireTimeSpan = TimeSpan.FromDays(ExpireFromDays),
Provider = new CookieAuthenticationProvider
{
OnResponseSignIn = signInContext =>
{
signInContext.Properties.IssuedUtc = DateTime.UtcNow;
signInContext.Properties.ExpiresUtc = DateTime.UtcNow.Add(TimeSpan.FromDays(ExpireFromDays));
}
}
});
Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)
1 Answer(s)
-
0
Hi,
Did you try setting
options.SignOutWreplyforAddWsFederationin AuthConfigurer.cs ?Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)