Authentication and authorization

In the previous chapterwhere we started upgrading our console application to a web applicationwe added Create, Read, Update, and Delete (CRUD) operations, which are available publicly to any user who is able to perform them. There is nothing coded to restrict a particular user from performing these operations. The risk with this is that users who are not supposed to perform these operations can easily do so. The consequences of this are as follows:

  • Unattended access
  • An open door for hackers/attackers
  • Data leakage issues

Now, if we are keen to safeguard our application and restrict the operations to permitted users only, then we have to implement a design that only allows these users to perform operations. ...

Get Hands-On Design Patterns with C# and .NET Core now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.