【发布时间】:2017-06-22 16:03:26
【问题描述】:
我使用 ASP.NET Identity 实现了 Identity Server 4。我之前问了一个关于如何应用某些登录规则的问题,并收到了解释如何在Startup.cs 中添加一些选项的答案。这是我在ConfigureServices 方法中添加的内容:
services.AddIdentity<ApplicationUser, IdentityRole>(options =>
{
options.Lockout.DefaultLockoutTimeSpan = TimeSpan.FromMinutes(15);
options.Lockout.MaxFailedAccessAttempts = 5;
options.Password.RequiredLength = 9;
options.Password.RequireDigit = true;
options.Password.RequireLowercase = true;
options.Password.RequireUppercase = true;
options.Password.RequireNonAlphanumeric = false;
options.SignIn.RequireConfirmedEmail = true;
})
.AddEntityFrameworkStores<ApplicationDbContext>()
.AddDefaultTokenProviders();
密码规则似乎有效,但锁定规则无效。有什么我需要启用的吗?
【问题讨论】:
标签: identityserver3 identityserver4