开发者

ASP.NET Membership PasswordLength and other properties

开发者 https://www.devze.com 2022-12-19 16:46 出处:网络
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.

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="AspNetSqlProvi开发者_如何学Pythonder" />
          <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


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>


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>
0

精彩评论

暂无评论...
验证码 换一张
取 消