Web API uses a completely different filter infrastructure than MVC. As a result, you will not be able to use MVC's FilterAttributeFilterProvider class to change the behavior of Web API. Instead, you will have to create a provider implementing the Web API-specific
IFilterProvider interface. The provider implementation that is responsible for returning filters registered via filter attributes is the
ActionDescriptorFilterProvider class.
marcind
Contributor
3344 Points
609 Posts
Microsoft
Re: FilterAttributeFilterProvider not firing for AuthorizationFilterAttribute
Apr 07, 2012 07:06 AM|LINK
Hi,
Web API uses a completely different filter infrastructure than MVC. As a result, you will not be able to use MVC's FilterAttributeFilterProvider class to change the behavior of Web API. Instead, you will have to create a provider implementing the Web API-specific IFilterProvider interface. The provider implementation that is responsible for returning filters registered via filter attributes is the ActionDescriptorFilterProvider class.
Hope this helps.
ASP.NET Team
@marcind
Blog