title: ASP.NET Identity not set in login request
body: <p>I'm using ASP.NET identity with a <code>ClaimsIdentity</code> to authenticate my users. When a user is authenticated, the property <code>User.Identity</code> contains a <code>ClaimsIdentity</code> instance.</p>
  
  <p>However, this is not the case during the Login request:</p>
  
  <pre><code>    public async Task&lt;ActionResult&gt; Login(LoginViewModel model, string returnUrl)
      {
          if (!ModelState.IsValid)
          {
              return View(model);
          }
  
          var result = await SignInManager.PasswordSignInAsync(model.Email, model.Password, false, shouldLockout: false);
          switch (result)
          {
              case SignInStatus.Success:
                  var identity = User.Identity;
  
  ------------&gt;   // identity is of type WindowsIdentity  &lt;------------
  
                  return RedirectToLocal(returnUrl);
  </code></pre>
  
  <p>As you can see, even though the login was successful, the property <code>User.Identity</code> is not yet set to the <code>ClaimsIdentity</code> instance. I think this is plausible, it means that the <code>SignInManager</code> does not update the property, so we have to wait until the next request to see the result of the login.</p>
  
  <p><strong>However, I have to do additional logic after the method <code>PasswordSignInAsync</code>, so I need a way to get the <code>ClaimsIdentity</code> instance in the <em>.Success</em> branch of the switch statement.</strong></p>
  
  <p>While inspecting the <code>SignInManager</code> in the debugger, I saw that it is of type <code>Microsoft.Owin.Security.AuthenticationManager</code>, which has the property <code>SignInEntry.Item1</code> which contains the <code>ClaimsIdentity</code> I'm looking for.</p>
  
  <p>However, the type <code>Microsoft.Owin.Security.AuthenticationManager</code> is not public, so the only way seems to be a hack using reflection.</p>
  
  <p><strong>Is there an better way?</strong></p>