Implementing authorization and advanced authentication features
We now have a new term to learn about – authorization. We have mentioned authentication many times, but what is authorization? It is a mechanism on top of authentication that restricts access to resources even for authenticated users.
We gave the example of an employee being allowed access to their company building because they proved that they are an employee. That’s authentication. Authorization, on the other hand, means the employee cannot access all the departments inside the building. They require a special role, or permission, to do that.
In software, the same concepts apply: the user is authenticated after successfully logging in, but authorization means that the user cannot take certain actions or access certain features without a specific role or permission.
In this section, we will discover how to implement authorization using the Blazor authentication library with roles or policies. After...