title: Check if a password is valid using ASP.NET Identity 2
body: <p>On my website, I give the administrators the possibility to change someone's password without entering the old one. I do the following:</p>
  <pre><code>userManager.RemovePassword(oldUser.Id);
  userManager.AddPassword(oldUser.Id, newPassword);
           
  </code></pre>
  <p>However, this changes the password only if the newPassword string complies with the password policy set in the configuration files. AddPassword seems to fail silently when the new password does not fulfil the requirements.</p>
  <p>Is there some simple way to check if a password is valid according to the current policy, apart from the obvious &quot;manual procedure&quot; (check how many upper/lowercase chars there are, how many digits, etc.). I'm looking for something like</p>
  <pre><code>bool valid = IsPasswordValid(&quot;pass&quot;);
  </code></pre>