title: How to return an IHttpActionResult inside an MVC Controller?
body: <p>I'm tinkering with an MVC <code>Controller</code>, having lifted some code out of an <code>ApiController</code>:</p>
  
  <pre><code>public class LoginController : Controller
  {
      public async Task&lt;IHttpActionResult&gt; Login(LoginModel model)
      {
          var success = await _accountClient.Login(model);
          if (!success)
          {
              return new UnauthorizedResult(Enumerable.Empty&lt;AuthenticationHeaderValue&gt;(), new HttpRequestMessage());
          }
          return new OkResult(new HttpRequestMessage());
      }
  }
  </code></pre>
  
  <p>This just doesn't look or feel right, particularly the part where I'm creating a new <code>HttpRequestMessage</code>; I'm pretty sure that should somehow come from the incoming <code>Request</code>, but I can't figure out where that's supposed to come from.</p>
  
  <p>Also, how do you create the <code>IEnumerable&lt;AuthenticationHeaderValue&gt;</code> object for the <code>challenges</code> parameter to the <code>UnauthorizedResult</code> constructor?</p>