Steve
Steve

Reputation: 1058

ASP.NET Membership PasswordLength and other properties

I am going crazy, when I go into the Web Site Administration Tool to create some new users, it always tells me that my password is not 7 characters long.

Error msg:

Password length minimum: 7. Non-alphanumeric characters required: 1.

Here is my web.config, seems like it is not even looked at.

 <membership userIsOnlineTimeWindow="20">
       <providers>
         <remove name="AspNetSqlProvider" />
          <add name="AspNetSqlProvider" connectionStringName="LocalSqlServer"
               type="System.Web.Security.SqlMembershipProvider"

              applicationName="OCIS"
               minRequiredPasswordLength="3"/>
       </providers>
    </membership>

I even went as far to modify the machine.config and after rebooting, still the same result. Very frustrating.

You guys have any ideas why my web.config files seems to be ignored?

Thank you,

Steve

Upvotes: 1

Views: 619

Answers (2)

m3kh
m3kh

Reputation: 7941

The AspNetSqlProvider is not the default provider name that is defined in the MembershipSection. Thus, you have to set the default provider name as follows.

<membership defaultProvider="AspNetSqlProvider">
  <providers>
    <add name="AspNetSqlProvider" ... />
  </providers>
</membership>

Upvotes: 2

Sky Sanders
Sky Sanders

Reputation: 37104

You probably should never have need to modify machine.config but I understand your frustration.

First, try implementing all properties of the provider in your local config to your specs and see what happens..

<membership>
  <providers>
    <add
      name="AspNetSqlMembershipProvider"
      type="System.Web.Security.SqlMembershipProvider, ..."
      connectionStringName="LocalSqlServer"
      enablePasswordRetrieval="false"
      enablePasswordReset="true"
      requiresQuestionAndAnswer="true"
      applicationName="/"
      requiresUniqueEmail="false"
      passwordFormat="Hashed"
      maxInvalidPasswordAttempts="5"
      minRequiredPasswordLength="7"
      minRequiredNonalphanumericCharacters="1"
      passwordAttemptWindow="10"
      passwordStrengthRegularExpression=""
    />
  </providers>
</membership>

Upvotes: 0

Related Questions