public static OntoIdentityUserManager Create(IdentityFactoryOptions <OntoIdentityUserManager> options, IOwinContext context) { var manager = new OntoIdentityUserManager(new UserStore <OntoIdentityUser>(context.Get <IdentityUserDbContext>())); // Configure validation logic for usernames manager.UserValidator = new CustomUserValidator(manager) { AllowOnlyAlphanumericUserNames = false, RequireUniqueEmail = true }; // Configure validation logic for passwords manager.PasswordValidator = new CustomPasswordValidator { RequiredLength = 6, RequireNonLetterOrDigit = false, RequireDigit = true, RequireLowercase = true, RequireUppercase = false }; // Configure user lockout defaults manager.UserLockoutEnabledByDefault = true; manager.DefaultAccountLockoutTimeSpan = TimeSpan.FromMinutes(5); manager.MaxFailedAccessAttemptsBeforeLockout = 5; var dataProtectionProvider = options.DataProtectionProvider; if (dataProtectionProvider != null) { manager.UserTokenProvider = new DataProtectorTokenProvider <OntoIdentityUser>(dataProtectionProvider.Create("ASP.NET Identity")); } return(manager); }
public OntoIdentitySignInManager(OntoIdentityUserManager userManager, IAuthenticationManager authenticationManager) : base(userManager, authenticationManager) { }