login control validation - how use simple password?

  • Thread starter Thread starter VB Programmer
  • Start date Start date
V

VB Programmer

In ASP.NET 2.0, the login control seems to automatically want strong
passwords. How can I allow simple passwords, such as 6 in length with at
least 1 number?

Thanks!
 
In your web.config inside system.web add this:

<membership>
<providers>
<remove name="AspNetSqlMembershipProvider" />
<add connectionStringName="LocalSqlServer"
enablePasswordRetrieval="false"
enablePasswordReset="true" requiresQuestionAndAnswer="false"
applicationName="/" requiresUniqueEmail="false"
passwordFormat="Hashed"
maxInvalidPasswordAttempts="5" minRequiredPasswordLength="2"
minRequiredNonalphanumericCharacters="0"
passwordAttemptWindow="10"
passwordStrengthRegularExpression=""
name="AspNetSqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider, System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</providers>
</membership>

Also, you may need to edit some details according to your database.
notice the options you have for your password strength. use it wisely!
;)

Yossi.
 
You can set the password regular expression in the membership element of the
web.config file. See sample below.

<membership defaultProvider="MyProvider">
<providers>
<add name="MyProvider" connectionStringName="MyDB"
applicationName="MyWebsite" enablePasswordRetrieval="false"
enablePasswordReset="true" requiresQuestionAndAnswer="true"
requiresUniqueEmail="false" passwordFormat="Hashed"
minRequiredPasswordLength="6"
minRequiredNonalphanumericCharacters="0"
passwordStrengthRegularExpression="^[put your regex here]$"
maxInvalidPasswordAttempts="5" passwordAttemptWindow="5"
type="System.Web.Security.SqlMembershipProvider"/>
</providers>
</membership>

There are some other details associated with setting up the provider that
don't come me right now. But this works for me.

Good luck,
Eagle
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top