【发布时间】:2016-09-16 02:43:37
【问题描述】:
我正在尝试为使用 ASP.NET Identity 3 的 ASP.NET 5 RC1 应用程序设置 validateInterval
我正在尝试实现this答案中的代码。
有很多像this answer 这样的代码示例,但它似乎在 ASP.NET 5 RC1 中无效
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
Provider = new CookieAuthenticationProvider
{
OnValidateIdentity = SecurityStampValidator.OnValidateIdentity<ApplicationUserManager, ApplicationUser>(
validateInterval: TimeSpan.FromMinutes(15))
},
ExpireTimeSpan = TimeSpan.FromMinutes(30)
});
如果我尝试在ASP.NET 5 RC1 中使用上面的代码示例,我就不行了
Provider 不是CookieAuthenticationOptions 的属性
并且 Visual Studio 无法通过其灯泡选项在任何命名空间中找到 CookieAuthenticationProvider。
如何在ASP.NET 5 RC1 中设置validateInterval?
【问题讨论】:
标签: c# asp.net-core asp.net-core-mvc asp.net-identity asp.net-identity-3