Example #1
0
        public static XUserManager Create(IdentityFactoryOptions <XUserManager> options, IOwinContext context)
        {
            var store   = new UserStore <XUser, XRole, long, XLogin, XUserRole, XClaim>(context.Get <XAppDbContext>());
            var manager = new XUserManager(store, options ?? new IdentityFactoryOptions <XUserManager>());

            SetupValidation(manager);

            return(manager);
        }
Example #2
0
 private static void SetupValidation(XUserManager manager)
 {
     manager.UserValidator = new UserValidator <XUser, long>(manager)
     {
         AllowOnlyAlphanumericUserNames = false,
         RequireUniqueEmail             = true
     };
     // Configure validation logic for passwords
     manager.PasswordValidator = new PasswordValidator
     {
         RequiredLength          = 6,
         RequireNonLetterOrDigit = true,
         RequireDigit            = true,
         RequireLowercase        = true,
         RequireUppercase        = true
     };
 }