0

In Asp.Net MVC 5 I was able to do somehting like this:

public class CustomAuthorizeAttribute : AuthorizeAttribute
{
    protected override bool AuthorizeCore(HttpContextBase httpContext)
    {
        // return true or false 
    }
}

And then use it as attribute on actions. Is it possible to do it in Asp.Net Core 2.1 and if it is, how to do it?

Aleksa
  • 2,608
  • 3
  • 26
  • 39
  • You are recommended not to do this in ASP.NET Core. It has a different approach to authorization, the docs are pretty good: https://docs.microsoft.com/en-us/aspnet/core/security/authorization/introduction?view=aspnetcore-2.2 – juunas Dec 19 '18 at 10:27
  • @user1336 Yes, it is duplicate, I found the solution in your link. – Aleksa Dec 19 '18 at 10:34

0 Answers0