[ASP. NET]: it can be used to verify the source (DB verification establishment and extraction)

Source: Internet
Author: User

 

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.

Related Article

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.