Friday, January 13, 2017

ASP.NET Core MVC–Register a global authorization filter

ASP.NET Core MVC still supports the concept of action filters. On the project I’m currently working on I wanted to add a global Authorization filter.

So similar to ASP.NET MVC, I tried to add the AuthorizeAttribute as a global filter:

However this didn’t work. In ASP.NET Core MVC the Attribute class and the filter implementation are separated from each other. Instead I had to use the following code:

1 comment:

Macrosoft said...

Good explain about core mvc.

Convert ASP to ASP.Net