Modify Strong Password rules in ASP. net2.0 built-in Member Management

Source: Internet
Author: User

Error message:
The minimum password length is 7, which must contain the following non-alphanumeric characters: 1

Solution:
The above message is mainly generated when you create a user. It is also generated when you create a user using the Asp.net website management tool.
There are two main methods to change the above rules:
1. All sites are changed.
Find the machine. config file.

< Membership >
< Providers >
< Add Name = "Aspnetsqlmembershipprovider"
Type
= "System. Web. Security. sqlmembershipprovider, system. Web, version = 2.0.0.0, culture = neutral, publickeytoken = b03f5f7f11d50a3a"
Connectionstringname
= "Localsqlserver"
Enablepasswordretrieval
= "False"
Enablepasswordreset
= "True"
Requiresquestionandanswer
= "True"
Applicationname
= "/"
Requiresuniqueemail
= "False"
Passwordformat
= "Hashed"
Maxinvalidpasswordattempts
= "5"
Minrequiredpasswordlength
= "7"
Minrequirednonalphanumericcharacters
= "1"
Passwordattemptwindow
= "10"
Passwordstrengthregularexpression
= ""   />
</ Providers >
</ Membership >

There are two attributes, one is minrequiredpasswordlengthIndicates the longest password. The default value is 7.The other isMinrequirednonalphanumericcharacters. The default value is 1, which means there must be at least one non-letter character. You only need to change it to 0.

2. If you only want to modify the Web. config value for a website, it will be OK.
Modify the precedingCodeInsert it under <system. Web>.

If you want to change the password rule to "at least 6 Characters without special characters", as follows:
(Note: you must add <remove name = "aspnetsqlmembershipprovider"/>. Otherwise, an error message indicating "aspnetsqlmembershipprovider has been added" is displayed)

< Membership >
< Providers >
<Remove name = "aspnetsqlmembershipprovider"/>
< Add Name = "Aspnetsqlmembershipprovider"
Type
= "System. Web. Security. sqlmembershipprovider, system. Web, version = 2.0.0.0, culture = neutral, publickeytoken = b03f5f7f11d50a3a"
Connectionstringname
= "Localsqlserver"
Enablepasswordretrieval
= "False"
Enablepasswordreset
= "True"
Requiresquestionandanswer
= "True"
Applicationname
= "/"
Requiresuniqueemail
= "False"
Passwordformat
= "Hashed"
Maxinvalidpasswordattempts
= "5"
Minrequiredpasswordlength
= "6"
Minrequirednonalphanumericcharacters
= "0"
Passwordattemptwindow
= "10"
Passwordstrengthregularexpression
= ""   />
</ Providers >
</ Membership >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.