I know this is an older question, but hopefully someone (maybe even myself) can find the value in the answer.
MVC6 really has an alternative. You have
public abstract class AuthorizationFilterAttribute : Attribute, IAsyncAuthorizationFilter, IAuthorizationFilter, IOrderedFilter
which basically tells you that you can create your own class, infer it from it (the namespace of all these interfaces, btw, is equal to Microsoft.AspNet.Mvc.Filters , and that should be it). You can either decorate this action, or you can do it in Startup.cs to apply to all actions:
public void ConfigureServices(IServiceCollection services) {
If you want to use a little more logical in the filter (for example, my LogFilter above), which is created through DI, you need to use the Service Filters or type filters .
Now you can decorate actions with [ServiceFilter(typeof(LogFilter))] or use o.Filters.Add(new ServiceFilterAttribute(typeof(LogFilter))); in the file Startup.cs. But keep in mind, for this you need to register a type with a DI container , as I did above with a call to .AddTransient<>() .
source share