예제 #1
0
 public AppUserManager(
     AppUserStore store,
     AppClaimsFactory claimsFactory,
     OAuthAuthorizationServerOptions oAuthServerOptions,
     OAuthBearerAuthenticationOptions oAuthBearerOptions)
     : base(store)
 {
     _oAuthServerOptions   = oAuthServerOptions;
     _oAuthBearerOptions   = oAuthBearerOptions;
     ClaimsIdentityFactory = claimsFactory;
     UserValidator         = new AppUserValidator(this)
     {
         AllowOnlyAlphanumericUserNames = true,
         RequireUniqueEmail             = true
     };
     PasswordValidator = new AppPasswordValidator
     {
         RequiredLength = 6,
         RequireDigit   = true
     };
 }
예제 #2
0
        public void AppPasswordValidator_RequiresUppercaseChar()
        {
            var passwordValidator = new AppPasswordValidator();

            Assert.IsTrue(passwordValidator.RequireUppercase);
        }
예제 #3
0
        public void AppPasswordValidator_DoesNot_RequireDigit()
        {
            var passwordValidator = new AppPasswordValidator();

            Assert.IsFalse(passwordValidator.RequireDigit);
        }
예제 #4
0
        public void AppPasswordValidator_RequiresNonLetterOrDigit()
        {
            var passwordValidator = new AppPasswordValidator();

            Assert.IsTrue(passwordValidator.RequireNonLetterOrDigit);
        }
예제 #5
0
        public void AppPasswordValidator_RequiresAtLeast6CharPassword()
        {
            var passwordValidator = new AppPasswordValidator();

            Assert.AreEqual(6, passwordValidator.RequiredLength);
        }