title: OWIN Authentication not authenticating
body: <p>I'm new to OWIN authentication and I am trying to get the (seemingly) basic to work. </p>
  
  <p>When I post to my Login action "_signInManager.PasswordSignInAsync" returns a success however my IPrincipal User does not seem to be updated. Additionally if I perform separate tests (I.E performing a userManager.FindByEmail and doing a count on the logins, or trying SignInManager.GetVerifiedUserId) I don't get any history of successful login attempts. So when the redirect happens .net has forgotten about the logged in user and acts as if it was never authenticated and I'm at a loss as to why.</p>
  
  <p>It is worth noting my Identity is a separate solution that is referenced by the main solution.</p>
  
  <h1>Main solution:</h1>
  
  <h2>Account Controller:</h2>
  
  <pre><code>    private ApplicationSignInManager _signInManager;
      private ApplicationUserManager _userManager;
  
      public AccountController()
      {
          _userManager = OwinContext.GetApplicationUserManager();
          _signInManager = OwinContext.GetApplicationSignInManager();
      }
  
      public AccountController(ApplicationUserManager userManager, ApplicationSignInManager signInManager)
      {
          _userManager = userManager;
          _signInManager = signInManager;
      }
  
      ***Other methods***
  
      [HttpPost]
      [AllowAnonymous]
      [ValidateAntiForgeryToken]
      public async Task&lt;ActionResult&gt; Login(Login model, string returnUrl)
      {
          if (!ModelState.IsValid)
          {
              return View(model);
          }
  
          // This doesn't count login failures towards account lockout
          // To enable password failures to trigger account lockout, change to shouldLockout: true
          var result = await _signInManager.PasswordSignInAsync(model.Email, model.Password, model.RememberMe, shouldLockout: false);
  
          switch (OwinContext.SignInResult(result))
          {
              case OwinContext.SignInStatus.Success:
                  if (User.IsInRole("Admin") || User.IsInRole("SuperAdmin"))
                  {
                      return RedirectToAction("UserList");
                  }
  
                  return RedirectToLocal(returnUrl);
              case OwinContext.SignInStatus.LockedOut:
                  return View("Lockout");
              case OwinContext.SignInStatus.RequiresVerification:
                  return RedirectToAction("SendCode", new { ReturnUrl = returnUrl, RememberMe = model.RememberMe });
              case OwinContext.SignInStatus.Failure:
              default:
                  ModelState.AddModelError("", "Invalid login attempt.");
                  return View(model);
          }
      }
  </code></pre>
  
  <h2>OWIN Context</h2>
  
  <pre><code>    private static IOwinContext GetOwinContext()
      {
          return HttpContextWrapper.GetCurrentContext().GetOwinContext();
      }
  
      public static ApplicationSignInManager GetApplicationSignInManager()
      {
          var applicationSignInManager = GetOwinContext().Get&lt;ApplicationSignInManager&gt;();
  
          return applicationSignInManager;
      }
  </code></pre>
  
  <h1>Identity solution</h1>
  
  <h2>Startup.cs</h2>
  
  <pre><code>using System.Data.Entity;
  using Microsoft.Owin;
  using Owin;
  using Shared_Identity.IdentityConfig;
  using Shared_Identity.Models.Context;
  
  namespace Shared_Identity
  {
      public partial class Startup
      {
          public void Configuration(IAppBuilder app)
          {
              //ConfigureAuth(app);
              Database.SetInitializer&lt;SharedIdentity&gt;(null);
              app.CreatePerOwinContext&lt;ApplicationUserManager&gt;(ApplicationUserManager.Create);
              app.CreatePerOwinContext&lt;ApplicationRoleManager&gt;(ApplicationRoleManager.Create);
              app.CreatePerOwinContext&lt;ApplicationSignInManager&gt;(ApplicationSignInManager.Create);
          }
      }
  }
  </code></pre>
  
  <p>I have tried the below:<br />
  <a href="https://stackoverflow.com/a/27282956/4046026">https://stackoverflow.com/a/27282956/4046026</a><br />
  <a href="https://stackoverflow.com/a/30734550/4046026">https://stackoverflow.com/a/30734550/4046026</a> - (confirmed DB connection string is correct)<br />
  <a href="https://stackoverflow.com/a/24643382/4046026">https://stackoverflow.com/a/24643382/4046026</a><br />
  <a href="https://stackoverflow.com/a/27500097/4046026">https://stackoverflow.com/a/27500097/4046026</a><br />
  along with looking at a few misc tutorials from Google but everywhere seems to suggest this should be straightforward. I'm probably missing something simple or have a conceptual issue.</p>