use email as Username with MVC5 Microsoft.AspNet.Identity

来源:互联网 发布:华大基因 尹烨 知乎 编辑:程序博客网 时间:2024/05/01 03:49

Solution:

In the AccountController constructor that takes a userManager as a parameter add the following code:

UserManager.UserValidator = new UserValidator<ApplicationUser>(UserManager)
 { AllowOnlyAlphanumericUserNames = false };
0 0