title: Asp.net Identity + Identity is not maintaining in subsequent request
body: <p>I am trying to implement Asp.net Identity in my web (MVC5) application. In User Authentication method I am authenticating user, if user exist then I am manually creating Claims Identity and Principal in my application  (Authentication.cs). After that I am assigning the Claims Principal to current HttpContext and Thread.  So now I am able to see  Identity in the same request httpcontext. But if I am trying to access Claims Identity from different action/page then it will show a null values in the User.Identity object, that is, Identity is not maintaing in the subsequent request.</p>
  
  <p>In my application I set AuthenticationMode="None" in web.config so I removed LoginPath attribute from OWIN Startup class.</p>
  
  <p>I am not sure what I missed here, please help me to fix this issue.</p>
  
  <pre><code>//OWIN startup.cs
  [assembly: OwinStartup(typeof(Web.Startup))]
  namespace Web
  {
  
  public class Startup
  {
      public void Configuration(IAppBuilder app)
      {
          // For more information on how to configure your application, 
  visit http://go.microsoft.com/fwlink/?LinkID=316888
          app.UseCookieAuthentication(new CookieAuthenticationOptions
          {
              AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
              CookieSecure = CookieSecureOption.Always
          });
  
      }
  }
  }
  
  
  //Authentication.cs
  //After user authentication, setting Thread and http context.
  if (user != null)
  {
  var authenticationManager = HttpContext.Current.GetOwinContext().Authentication;
  
  var claims = new List&lt;Claim&gt;();
  claims.Add(new Claim(ClaimTypes.Name, "username"));
  claims.Add(new Claim(ClaimTypes.Email, "username@gmail.com"));
  var userIdentity = new ClaimsIdentity(claims, DefaultAuthenticationTypes.ApplicationCookie);
  
  ClaimsPrincipal principal2 = new ClaimsPrincipal(userIdentity);
  
  authenticationManager.SignIn(new AuthenticationProperties() { IsPersistent = false }, userIdentity);
  
  var test = HttpContext.Current.User.Identity.IsAuthenticated; //return false
  
  
  HttpContext.Current.User = principal2;
  
  test = userIdentity.IsAuthenticated; // User Identity is authenticated return true
  System.Threading.Thread.CurrentPrincipal = principal2;
  test = HttpContext.Current.User.Identity.IsAuthenticated; //return true
  </code></pre>
  
  <p>}</p>
  
  <p>But if I redirect to different page/action then the values in User.Identity.IsAuthenticated is displaying as false.</p>
  
  <p>Thanks
  Selvakumar</p>