title: Filter is not executed in C# WebAPI even though it is registered globally
body: <p>I am doing a WebAPI with a filter which is intended to authenticate users, but whenever I call GET, PUT, POST or DELETE, my filter method isn´t triggered. </p>
  
  <p>I have already read many answers saying the following stuff:</p>
  
  <ul>
  <li>Use an IAuthorizationFilter </li>
  <li>Use an IAuthenticationFilter</li>
  <li>Use an ActionFilterAttribute</li>
  </ul>
  
  <p>And also:</p>
  
  <ul>
  <li>Apply the attribute at the top of controller or action</li>
  <li>Register the filter in FilterConfig and register global filters in Global.Asax</li>
  </ul>
  
  <p>Tried all of them:</p>
  
  <p><strong>Filter:</strong></p>
  
  <pre><code>    namespace CumminsGroup.Filters
  {
      public class AuthenticationFilter : ActionFilterAttribute
      {
          public override void OnActionExecuting(ActionExecutingContext filterContext)
          {
              Console.WriteLine("filterContext");
              //use filterContext.HttpContext.Request...
          }
      }
  }
  </code></pre>
  
  <p><strong>ApiController:</strong></p>
  
  <pre><code>    namespace CumminsGroup.Controllers
  {
      [EnableCors(origins: "*", headers: "*", methods: "*")]
      [AuthenticationFilter]
      public class UserGroupsController : ApiController
      {        
          // GET: api/Groups
          public IQueryable&lt;Group&gt; GetGroups()
          {
              return db.Groups.Include("GroupUsers").Where(u=&gt;u.status=="active");
          }
  </code></pre>
  
  <p><strong>FilterConfig:</strong></p>
  
  <pre><code>namespace CumminsGroup
  {
      public class FilterConfig
      {
          public static void RegisterGlobalFilters(GlobalFilterCollection filters)
          {
              filters.Add(new AuthenticationFilter());
              //filters.Add(new HandleErrorAttribute());
          }
      }
  }
  </code></pre>
  
  <p><strong>Global.asax:</strong></p>
  
  <pre><code>namespace CumminsGroup
  {
      public class WebApiApplication : System.Web.HttpApplication
      {
          protected void Application_Start()
          {
              FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
              AreaRegistration.RegisterAllAreas();
              GlobalConfiguration.Configure(WebApiConfig.Register);           
              RouteConfig.RegisterRoutes(RouteTable.Routes);
              BundleConfig.RegisterBundles(BundleTable.Bundles);
          }
      }
  }
  </code></pre>
  
  <p>Still when a do an HTTP request, the filter is skiped.
  The only moment when the filter funcion is called is right before the home page controller, when I run the project.</p>
  
  <p>What am I missing?</p>