Hi,
I was able to configure the two factor authentication cookie name / expiry time in ASP .NET Core 1.0 using the following code.
services.AddIdentity<ApplicationUser, IdentityRole>(o => { // Configure Identity Options o.Cookies.TwoFactorUserIdCookie.CookieName = "twofactor_login"; o.Cookies.TwoFactorRememberMeCookie.CookieName = "twofactor_remember"; o.Cookies.TwoFactorRememberMeCookie.SlidingExpiration = false; o.Cookies.TwoFactorRememberMeCookie.ExpireTimeSpan = TimeSpan.FromDays(1); }) .AddEntityFrameworkStores<AppDbContext>() .AddDefaultTokenProviders();
In ASP Core 2.0, I'm able to find the option only for configuring application cookie, not the two factor cookies.
services.ConfigureApplicationCookie(o => { o.Cookie.Name = "app_user"; o.Cookie.Expiration = TimeSpan.FromMinutes(30); o.ExpireTimeSpan = TimeSpan.FromMinutes(30); o.SlidingExpiration = true; o.LoginPath = new PathString("/account/login"); });
Please provide your thoughts on this.