Preface:
Previous Article: [ASP. NET]: Alternative authentication source (LDAP verification, Windows verification ...)
This section describes how to use a self-made CLK. Web library to implement ASP. NET convertible authentication sources.
The so-called alternative verification means different requirements can be met. Use ad to authenticate users, dB to authenticate users, or other authentication sources.
This article describes how to implement the source of verification. The source of verification in this article is a data source of the database type.
Implementation:
Download file: clk.web.security.rar
1. Enable the CLK. Web. Security Solution
2. Add CLK. Web. Security. extension to the new project.
3. Reference for adding CLK. Web. Security. extension to the new project
4. Join the user verification database
5. Add two data tables, user and userrole.
6. Create databaseformsauthenticationstrategy
Verify the logic
7. Create databaseformsauthenticationstrategyfactory
Databaseformsauthenticationstrategy Factory
8. Modify the Web. config of CLK. Web. Security. sample.
Mount database Verification
9. Add the DLL file and MDF file of CLK. Web. Security. Extension to CLK. Web. Security. sample.
10. Failed Login
11. Correct Logon
Program code authorization:
The program code is authorized by MIT license.