From the course: ASP.NET Core Identity: Authorization Management

What is authorization? - ASP.NET Core Tutorial

From the course: ASP.NET Core Identity: Authorization Management

Start my 1-month free trial

What is authorization?

[Instructor] Authorization is a concept which is strongly related to another concept, roles. Imagine you are a student in a school. Now, in a school we have classrooms, we have labs, we have teacher working rooms, et cetera. You, as a student, can go to the school. So, you have access to the school itself, but not to all the rooms within that school. For example, you can go to the classrooms, you can go to the labs that you are assigned to, but you cannot go to the teachers' working room. And that is because you need to be a teacher to go there. So, your role within your school needs to be a teacher. By using this same logic, we can implement authorization in our .NET Core apps. So, imagine we are building an app for a school. Within this app, we have two roles. So, we have the student and the teacher role. Now, we as developers, we need to make sure that whenever a user of role student signs in, the user should be able to see only student-related data. The same way, when a user of role teacher signs in, the user should be able to see only teacher-related data. So, for example, a teacher can see a list of all the students and their grades, but students can only see their own grades.

Contents