Ejemplo n.º 1
0
        public static PaskolUserManager Create(IdentityFactoryOptions <PaskolUserManager> options, IOwinContext context)
        {
            var manager = new PaskolUserManager(new PaskolUserStore(context.Get <PaskolDbContext>()));

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

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

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

            return(manager);
        }
Ejemplo n.º 2
0
 public ApplicationSignInManager(PaskolUserManager userManager, IAuthenticationManager authenticationManager)
     : base(userManager, authenticationManager)
 {
 }