I learned ASP. NET yesterday to log on to users. I know there are three methods for user authentication:
- Windows Verification
- Form Verification
- Passport (Windows Live ID) Verification
Of course, form verification is generally applied. For the method of passport (Windows Live ID) Verification, You can Google it and get a more detailed answer.
Form Verification. We can modify the Web. config file implementation as follows:
1 <authentication mode="Forms">
2 <forms>
3 <credentials passwordFormat="SHA1">
4 <user name="jaychou" password="25B49F3D15E7BB34B208E993E3B3FE62B0FB33E6"/>
5 <user name="choujay" password="choujay"/>
6 </credentials>
7 </forms>
8 </authentication>
In passwordformat of credentials, we can set the encryption mode of the password string. The default mode is not encrypted. Here we can select MD5 or sha1 encryption methods, as shown below, in the user password, you must enter the encrypted string of the original password.
Of course, we usually put users into the database. After we select the encryption method, the encrypted password string is stored in the database, Asp.. Net encrypts the original password entered by the user and compares it with the password stored in the database to verify the validity of the user.
If you need to manually enter the encrypted string, you need an MD5/HASH encryption tool (right-click and save it as) to convert the original password into the encrypted text.
The specific method is as follows: MD5 and hash encryption in. NET and ciphertext output (C #)