O'Reilly logo

ASP.NET Core Essentials by Shahed Chowdhuri

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using authorization for application features

As explained in the introduction to this chapter, authorization can be used to exclude a user from specific parts of an application once they have already been authenticated. In our Hospital Records application, we could restrict certain features so they are accessible to doctors but not nurses or patients.

High-level overview

Here is a high-level overview of how you can implement basic authorization techniques in an ASP.NET Core application:

  1. Use the Authorization namespace in your controller code.
  2. Grant authorization at the controller class level.
  3. Grant authorization at the controller action method level.
  4. Grant anonymous access at the controller class level.
  5. Grant anonymous access at the controller action ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required