asp.net membership additional password policy rules

1.9k Views Asked by At

I'm using asp.nbet membership which very handily gives you the choice of enforcing a min password length and the minimum numeric characters. Can you define others like there must be one upper-case character, etc?

cheers

2

There are 2 best solutions below

1
On BEST ANSWER

It looks like the only other option is minRequiredNonAlphanumericCharacters, so no. But that doesnt stop you from putting a validator on the Login control password field.

0
On

There is also the ability to use a Regex against the password. The below is taken from this blog has some details:

http://weblogs.asp.net/pleloup/archive/2005/12/05/432359.aspx

Using regular expression

<membership ...>
  <providers>
    <add passwordStrengthRegularExpression= 
                "^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,10}$" .../>
  </providers>
</membership>

Using minimum length and non-alphanumeric character

 <membership ...>
  <providers>
    <add minRequiredPasswordLength=10 minRequiredNonalphanumericCharacters=2 .../>
  </providers>
 </membership>