小编MDu*_*MDu的帖子

每次请求都调用ApplicationUserManager.Create

我正在使用asp.net mvc 5与外部提供商owin提供(facebook,twitter)

每次请求都会调用ApplicationUserManager.Create.登录用户有很多不必要的东西(密码验证器配置或短信和电子邮件服务配置....)

var manager = new ApplicationUserManager(new UserStore<ApplicationUser>(context.Get<ApplicationDbContext>()));
            // Configure validation logic for usernames
            manager.UserValidator = new UserValidator<ApplicationUser>(manager)
            {
                AllowOnlyAlphanumericUserNames = true,
                RequireUniqueEmail = true
            };

            // Configure validation logic for passwords
            manager.PasswordValidator = new PasswordValidator
            {
                RequiredLength = 7,
                RequireNonLetterOrDigit = false,
                RequireDigit = true,
                RequireLowercase = true,
                RequireUppercase = true,
            };
...
Run Code Online (Sandbox Code Playgroud)

此外,我认为这与此有关

public partial class Startup
    {    
        public void ConfigureAuth(IAppBuilder app)
      // Configure the db context, user manager and signin manager to use a  single …
Run Code Online (Sandbox Code Playgroud)

c# asp.net asp.net-mvc asp.net-identity-2

14
推荐指数
1
解决办法
891
查看次数

标签 统计

asp.net ×1

asp.net-identity-2 ×1

asp.net-mvc ×1

c# ×1