title: Web API Custom Filter not firing
body: <p>I have created a custom Filter Attribute that will be doing some basic token validation. So I started by just adding a few lines to see with it works correctly but for some reason is it not working.</p>
  
  <p><strong>Custom Filter Class</strong></p>
  
  <pre><code>/// &lt;summary&gt;
  /// Basic Token Based Authitication 
  /// &lt;/summary&gt;
  public class BasicTokenValidation : ActionFilterAttribute
  {
      /// &lt;summary&gt;
      /// Validate Token
      /// &lt;/summary&gt;
      /// &lt;param name="actionContext"&gt;&lt;/param&gt;
      public override void OnActionExecuting(HttpActionContext actionContext)
      {
          HttpContext.Current.Response.Write(" filter1 ");
          Debug.WriteLine("Executing My Filter!");
          if (actionContext.Request.Headers.Authorization == null)
          {
              actionContext.Response = new System.Net.Http.HttpResponseMessage(System.Net.HttpStatusCode.Unauthorized);
          }
          else {
              string authToken = actionContext.Request.Headers.Authorization.Parameter;
          }
  
          base.OnActionExecuting(actionContext);
      }
  }
  </code></pre>
  
  <p>I registered it in <strong>WebApi.config</strong></p>
  
  <pre><code>config.Filters.Add(new BasicTokenValidation());
  </code></pre>
  
  <p>Here is how I decorated my Controller method</p>
  
  <pre><code>[HttpGet]
  [Route("get/all")]
  [BasicTokenValidation]
  public IHttpActionResult GetAll()
  {
      try
      {
  
          // Some Code
      }
      catch (Exception ex)
      {
          return InternalServerError(ex);
      }
  }
  </code></pre>
  
  <p>Not sure if I need to configure something else. Did read a few post and articles and to some I do have everything what I need to create custom filters.</p>
  
  <p>Any assistance would be appreciated.</p>
  
  <p>Thanks</p>