Enterprise Library Step by Step Series (v) Secure Application Block

Source: Internet
Author: User

A Security Application Block Overview:

The secure Application Block enables developers to implement common security-related tasks in their applications through one or more security mechanisms.

You need to improve extensibility so that you can change the authentication or authorization mode without changing the application code.

Features are provided in the following areas:

1. Certification

2. Authorized

3. Role management

4. Profile Management

Two A few important concepts:

1. Credential (token)

2. Identity (identities)

3. Principal (main feature)

Three Using the trilogy:

Make sure that you have app.config or Web.config files in your project before you use them, and that you need related tables and stored procedures in your database, as you can see in the Database Entlibquickstarts (sample library of Enterprise library).

1. To define a configuration file:

(1) Run Enterprise Library Configuration Configuration tool, open the configuration file in the project;

(2) Right-click Application, select New | Security application blocks, creating a secure application Block;

(3) in Security Application Block | Right-click on Authentication node, select New | DB authentication Provider, create a database authentication Provider;

(4) Set the connection string of the database according to the data Access Application Block;

(5) Right-click Cryptography Application Block | Hash Providers, select New | Hash algorithm Provider, create an encryption Provider, and set saltenabled to true;

(6) Select Security Application Block | Authentication | Database Provider, set the database property to database Instance, and set the Hashprovider property to SHA1Managed;

(7) Select Security Application Block and set its defaultauthenticationinstance as database Provider;

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.