Ejemplo n.º 1
0
        public static BlogUserManager Create(IdentityFactoryOptions <BlogUserManager> options,
                                             IOwinContext context)
        {
            var dataBase = context.Get <BlogDbContext>();
            var manager  = new BlogUserManager(new UserStore <User>(dataBase));

            manager.UserValidator = new UserValidator <User>(manager)
            {
                AllowOnlyAlphanumericUserNames = false,
                RequireUniqueEmail             = true,
            };

            manager.PasswordValidator = new PasswordValidator
            {
                RequiredLength = 6,
            };

            manager.UserLockoutEnabledByDefault          = true;
            manager.DefaultAccountLockoutTimeSpan        = TimeSpan.FromMinutes(5);
            manager.MaxFailedAccessAttemptsBeforeLockout = 5;

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