Skip to content

Security Utilities

Dennis C. Mitchell edited this page Mar 18, 2019 · 8 revisions

(under construction) EDennis.AspNetCore.Base provides some utility classes for making security configuration a little easier. Some of the classes, such as AutoLoginMiddleware and MockClientAuthorizationMiddleware, are helpful in certain testing scenarios. Those classes are described in the Testing section of the Wiki. Other security classes, described below, support production code.

A Convention for Default Authorization Policies

With ASP.NET, the developer has freedom to choose how authorization policies are defined and named. In some cases, business needs might drive the development of sophisticated policies. As a default, however, the develop might find it convenient to have some default authorization policies. EDennis.AspNetCore.Base provides methods for generating a set of default policies that cover the entire app, all actions in specific controllers, or specific controller actions. These generated default policies are summarized in the following table:

Default Policies Image

Automatic [Authorize]

When configuring security for MVC controllers and actions, often the developer will need to add an [Authorize] attribute with a policy name argument. Although the policy names can be anything the developer chooses,

Clone this wiki locally