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;