[英]How to disable account if user login fails continuously in Asp.Net Core identity
Currently, I'm using Asp.net core 1.1, EF core & Asp.net core Identity in my system. 目前,我在我的系统中使用Asp.net核心1.1,EF核心和Asp.net核心身份。 I have a configure below in
startup.cs
class for the password policy. 我在
startup.cs
类中有一个配置密码策略。
Is there a configure to disable account when a user continuously login fails? 是否有配置在用户连续登录失败时禁用帐户?
services.Configure<IdentityOptions>(options =>
{
// Password settings
options.Password.RequireDigit = true;
options.Password.RequiredLength = 6;
options.Password.RequireNonAlphanumeric = true;
options.Password.RequireUppercase = true;
options.Password.RequireLowercase = true;
}
In your account controller, scroll down to public async Task<ActionResult> Login(LoginViewModel model, string returnUrl)
在您的帐户控制器中,向下滚动到
public async Task<ActionResult> Login(LoginViewModel model, string returnUrl)
Once there, set shouldLockout
to true
在那里,将
shouldLockout
设置为true
var result = await SignInManager.PasswordSignInAsync(model.Email, model.Password, model.RememberMe, shouldLockout: true);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.