public static WebApiUserManager Create(IdentityFactoryOptions <WebApiUserManager> options, IOwinContext context, int idApplication) { var manager = new WebApiUserManager(new ApplicationUserStore(context.Get <ApplicationDbContext>(), idApplication)); manager.UserValidator = new UserValidator <ApplicationUser>(manager) { AllowOnlyAlphanumericUserNames = false, RequireUniqueEmail = true }; manager.PasswordValidator = new PasswordValidator { RequiredLength = 6, RequireNonLetterOrDigit = false, RequireDigit = false, RequireLowercase = false, RequireUppercase = false, }; var dataProtectionProvider = options.DataProtectionProvider; if (dataProtectionProvider != null) { manager.UserTokenProvider = new DataProtectorTokenProvider <ApplicationUser>(dataProtectionProvider.Create("ASP.NET Identity")); } return(manager); }
public ApplicationSignInManager(WebApiUserManager userManager, IAuthenticationManager authenticationManager) : base(userManager, authenticationManager) { }