Beispiel #1
0
        public static ApplicationCustomerManager Create(IdentityFactoryOptions <ApplicationCustomerManager> options, IOwinContext context)
        {
            var manager = new ApplicationCustomerManager(new UserStore <Customer>(context.Get <ApplicationDbContext>()));

            // Configure validation logic for usernames
            manager.UserValidator = new UserValidator <Customer>(manager)
            {
                AllowOnlyAlphanumericUserNames = false,
            };

            // Configure validation logic for passwords
            manager.PasswordValidator = new PasswordValidator
            {
                RequiredLength          = 6,
                RequireDigit            = true,
                RequireNonLetterOrDigit = true,
                RequireLowercase        = true,
                RequireUppercase        = true,
            };

            // Configure user lockout defaults
            manager.UserLockoutEnabledByDefault          = true;
            manager.DefaultAccountLockoutTimeSpan        = TimeSpan.FromMinutes(5);
            manager.MaxFailedAccessAttemptsBeforeLockout = 5;

            return(manager);
        }
Beispiel #2
0
 public ApplicationSignInManager(ApplicationCustomerManager userManager, IAuthenticationManager authenticationManager) : base(userManager, authenticationManager)
 {
 }