title: Are User in WebApiController and HttpContext.Current.User different?
body: <p>After referring <a href="http://stevescodingblog.co.uk/basic-authentication-with-asp-net-webapi/" rel="nofollow">this post</a>, I wrote an attribute for Basic Http Authentication to be used in the web api. In the attribute class, if the credentials provided match, then I am setting the HttpContext.Current.User as </p>
  
  <pre><code> HttpContext.Current.User = new GenericPrincipal(new ApiIdentity(apiUser), new string[] {});
  
  base.OnActionExecuting(actionContext);
  </code></pre>
  
  <p>However, when I access User inside my api controller, it does not have the apiUser properties. </p>
  
  <p>Why is this and what is the correct way to set an Identity and then access it in api controller?</p>