title: Places you can add password validation in MVC?
body: <p>I've got a "ForceChangePassword" page for after "ForgotPassword" and it is randomly throwing two length requirements on the "NewPassword" field. The problem is, I never added a length requirement of 7 and have no idea where it is coming from or how to change it.</p>
  
  <p><strong>Errors from ModelState</strong></p>
  
  <pre><code>The New password must be at least 6 characters long.
  The 'New password' field is an invalid password. Password must have 7 or more characters.
  
  if (!ModelState.IsValid) { return View(model); } // Only line executed in the POST Action.
  </code></pre>
  
  <p>I set the length requirement to 6 on the ViewModel via Attribute (see below). I have no idea where the 7 requirement is coming from.</p>
  
  <p><strong>IdentityConfig.cs</strong></p>
  
  <pre><code>manager.PasswordValidator = new PasswordValidator
  {
      RequiredLength = 6,
      RequireNonLetterOrDigit = true,
      RequireDigit = true,
      RequireLowercase = true,
      RequireUppercase = true,
  };
  </code></pre>
  
  <p><strong>Model</strong></p>
  
  <pre><code>[Required]
  [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
  [MembershipPassword(
      MinRequiredNonAlphanumericCharacters = 1,
      MinNonAlphanumericCharactersError = "Your password needs to contain at least one symbol (!, @, #, etc).",
      ErrorMessage = "Your password must be 6 characters long and contain at least one symbol (!, @, #, etc)."
  )]
  [DataType(DataType.Password)]
  [Display(Name = "New password")]
  public string NewPassword { get; set; }
  </code></pre>
  
  <p><strong>View</strong></p>
  
  <pre><code>&lt;div class="form-group"&gt;
      @Html.LabelFor(m =&gt; m.NewPassword, new { @class = "col-md-2 control-label" })
      &lt;div class="col-md-10"&gt;
          @Html.PasswordFor(m =&gt; m.NewPassword, new { @class = "form-control", @autocomplete = "off" })
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>Culprit attribute:</strong></p>
  
  <pre><code>data-val-password-min="7"
  </code></pre>
  
  <p><strong>Question:</strong> Where are the possible locations to add password-length validation in an MVC 5 project using Identity 2.0? Could there be a default-requirement of some sort I'm just not setting?</p>
  
  <p><em>Note:</em> I'll add more code if necessary but I've posted all possibly relevant code I know of. Nothing else mentions passwords at all (to my knowledge, let me know if there are more locations).</p>