コード例 #1
0
ファイル: IdentityConfig.cs プロジェクト: Markiz9999/test-app
        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);
        }
コード例 #2
0
ファイル: IdentityConfig.cs プロジェクト: Markiz9999/test-app
 public ApplicationSignInManager(ApplicationCustomerManager userManager, IAuthenticationManager authenticationManager) : base(userManager, authenticationManager)
 {
 }