title: ASP.NET Identity password requirements overriding my own
body: <p>So I need to import a bunch of users into my ASP.NET Identity based system and some of he passwords are very short (as little as three characters) and beyond my control. I need to import these passwords so existing users can login and change their passwords to meet a more stringent requirement.</p>
  
  <p>I thought that by configuring the <code>PasswordValidator</code> property in my <code>ApplicationUserManager</code> class I could set the requirements for the imported password to a low number allowing me to import the existing user.</p>
  
  <pre><code>// Configure validation logic for passwords
  appUserManager.PasswordValidator = new PasswordValidator
  {
      RequiredLength = 3,
      RequireNonLetterOrDigit = false,
      RequireDigit = false,
      RequireLowercase = false,
      RequireUppercase = false,
  };
  </code></pre>
  
  <p>However when I import users and try and create a new record I get a validation error in the <code>IdentityResult</code>.</p>
  
  <pre><code>IdentityResult result = manager.Create(newUser, importedUser.Password);
  </code></pre>
  
  <p><code>result.Errors = "Passwords must be at least 6 characters."</code></p>
  
  <p>Is it not possible to override the Identity default requirements? </p>
  
  <p>Here is the entire ApplicationUserManager class for reference:</p>
  
  <pre><code>public class ApplicationUserManager : UserManager&lt;ApplicationUser&gt;
  {
      public ApplicationUserManager(IUserStore&lt;ApplicationUser&gt; store)
          : base(store)
      {
          PasswordValidator = new MinimumLengthValidator(3);
      }
  
      public static ApplicationUserManager Create(IdentityFactoryOptions&lt;ApplicationUserManager&gt; options, IOwinContext context)
      {
          var appDbContext = context.Get&lt;ApplicationDbContext&gt;();
          var appUserManager = new ApplicationUserManager(new UserStore&lt;ApplicationUser&gt;(appDbContext));
  
          // Configure validation logic for usernames
          appUserManager.UserValidator = new UserValidator&lt;ApplicationUser&gt;(appUserManager)
          {
              AllowOnlyAlphanumericUserNames = true,
              RequireUniqueEmail = false
          };
  
          // Configure validation logic for passwords
          appUserManager.PasswordValidator = new PasswordValidator
          {
              RequiredLength = 3,
              RequireNonLetterOrDigit = false,
              RequireDigit = false,
              RequireLowercase = false,
              RequireUppercase = false,
          };
  
          appUserManager.EmailService = new Services.EmailService();
  
          var dataProtectionProvider = options.DataProtectionProvider;
          if (dataProtectionProvider != null)
          {
              appUserManager.UserTokenProvider = new DataProtectorTokenProvider&lt;ApplicationUser&gt;(dataProtectionProvider.Create("ASP.NET Identity"))
              {
                  //Code for email confirmation and reset password life time
                  TokenLifespan = TimeSpan.FromHours(6)
              };
          }
  
          return appUserManager;
      }
  }
  </code></pre>