title: How to set a custom ClaimsPrincipal in MVC 5?
body: <p>I created a custom principal class</p>
  
  <pre><code>public class FacebookPrincipal : ClaimsPrincipal
  {
      public JObject Data { get; set; }
  }
  </code></pre>
  
  <p>And I want to use it. When the user logs in, I tried to set</p>
  
  <pre><code>var fbP = new FacebookPrincipal { Data = user.Data };
  
  Thread.CurrentPrincipal = fbP;
  AuthenticationManager.User = fbP;
  HttpContext.User = fbP;
  </code></pre>
  
  <p>It works right after I set it, but when I go ho <code>home/index</code> the value is lost</p>
  
  <pre><code>var user = HttpContext.GetOwinContext().Authentication.User;
  var bbbb = this.User;
  var cccc = ClaimsPrincipal.Current;
  </code></pre>
  
  <p>All the above methods return a Principal of type <code>ClaimsPrincipal</code> and casting to <code>FacebookPrincipal</code> returns null.</p>
  
  <p>How do I set a custom principal?</p>