如果要启用cookie的即时吊销,则每个请求都必须命中数据库以验证cookie。因此,延迟之间的权衡在于数据库负载。但是您始终可以将validationInterval设置为0。
app.UsecookieAuthentication(new cookieAuthenticationOptions{ AuthenticationType = DefaultAuthenticationTypes.Applicationcookie, LoginPath = new PathString("/Account/Login"), Provider = new cookieAuthenticationProvider { // Enables the application to validate the security stamp when the user logs in. // This is a security feature which is used when you change a password or add an external login to your account. onValidateIdentity = SecurityStampValidator.OnValidateIdentity<ApplicationUserManager, ApplicationUser>( validateInterval: TimeSpan.FromSeconds(0), regenerateIdentity: (manager, user) => user.GenerateUserIdentityAsync(manager)) }});
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)