public static SportsStoreUserManager Create(
            IdentityFactoryOptions <SportsStoreUserManager> options,
            IOwinContext context)
        {
            var manager = new SportsStoreUserManager(new UserStore(context.Get <SportsStoreContext>()));

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

            manager.PasswordValidator = new PasswordValidator
            {
                RequiredLength   = 8,
                RequireDigit     = true,
                RequireLowercase = true,
                RequireUppercase = true
            };

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

            return(manager);
        }
Beispiel #2
0
 public AccountService(
     IAuthenticationManager authenticationManager,
     SportsStoreUserManager userManager,
     IUserInformationService userInformationService)
 {
     this.authenticationManager  = authenticationManager;
     this.userManager            = userManager;
     this.userInformationService = userInformationService;
 }
Beispiel #3
0
 public async Task <ClaimsIdentity> GenerateUserIdentityAsync(SportsStoreUserManager manager)
 {
     return(await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie));
 }
Beispiel #4
0
 public SportsStoreSignInManager(SportsStoreUserManager userManager, IAuthenticationManager authenticationManager)
     : base(userManager, authenticationManager)
 {
 }