title: ASP.Net WebAPI OWIN: Why would Request.GetOwinContext() return null?
body: <p>In my production code we're having a problem where Request.GetOwinContext() always returns null.</p>
  
  <p>I setup a small test WebAPI controller to try and isolate the problem:</p>
  
  <pre><code>    public class TestController : ApiController
  {
      [HttpGet]
      public async Task&lt;IHttpActionResult&gt; GetAsyncContext(string provider)
      {
          if (HttpContext.Current.GetOwinContext() == null)
              return this.BadRequest("No HttpContext.Current Owin Context");
  
          if (Request.GetOwinContext() == null)
              return this.BadRequest("No Owin Context");
  
          return this.Ok();
      }
  
      [HttpGet]
      public IHttpActionResult GetContext(string provider)
      {
          if (HttpContext.Current.GetOwinContext() == null)
              return this.BadRequest("No HttpContext.Current Owin Context");
  
          if (Request.GetOwinContext() == null)
              return this.BadRequest("No Owin Context");
  
          return this.Ok();
      }
  }
  </code></pre>
  
  <p>At first I thought it might have something to do with the action method running asynchronously, but after running the above, it turns out that in both versions, Request.GetOwinContext() returns null.</p>
  
  <p>I am using Microsoft.AspNet.WebApi.Owin.5.1.1 (which is where it seems the GetOwinContext() extension method is defined).</p>
  
  <p>Any ideas on what's happening here???</p>