Please correct me if I am wrong, but isn;t this used to enforce the passwords being entered when users register? How is this used for the temporay password generated by the password recovery control?
Is there a way to just enforce the minimum pasword length on registration, but on password retrieveal limit the length of the auto generated password?
Main Topics
Browse All Topics





by: sajain84Posted on 2008-05-08 at 14:34:11ID: 21528672
Hi akobes05,
eshare.com /wiki/ ASP. NET_2.0_Se curity_Que stions_and _Answers_- _Authentic ation#How_ do_I_enfor ce_strong_ passwords_ using_memb ership_fea ture_in_AS P.NET_2.0
Asp.Net takes the password generation parameters from the Web.Config file.
If you want to change the minimum and maximum length, you'll have to do this via a regular expression.
The minimum length can be specified without the regular expression, but for the maximum length - the regular expression will be required.
In addition to the length, the regular expression can also be used to set rules to which the password should match.
Something like the code attached below.
The code below is not complete -- and is just a representation of how it should be.
The 8 is the minimum length and 10 is the maximum length.
You will also have to replace the regular expression with a different one suiting your needs.
Links:
More reading: http://www.securityguidanc
Regular Expression Library:
http://regexlib.com/
Select allOpen in new window