title: How to update a claim in ASP.NET Identity?
body: <p>I'm using OWIN authentication for my MVC5 project.
  This is my <code>SignInAsync</code></p>
  <pre><code> private async Task SignInAsync(ApplicationUser user, bool isPersistent)
          {
              var AccountNo = &quot;101&quot;;
              AuthenticationManager.SignOut(DefaultAuthenticationTypes.ExternalCookie);
              var identity = await UserManager.CreateIdentityAsync(user, DefaultAuthenticationTypes.ApplicationCookie);
              identity.AddClaim(new Claim(ClaimTypes.UserData, AccountNo));
              AuthenticationManager.SignIn(new AuthenticationProperties() { IsPersistent = isPersistent, RedirectUri=&quot;Account/Index&quot;}, identity);
          }
  </code></pre>
  <p>As you can see, i added <code>AccountNo</code> into the Claims list.</p>
  <p>Now,  how can I update this Claim at some point in my application? So far, i have this:</p>
  <pre><code> public string AccountNo
          {
  
              get
              {
                  var CP = ClaimsPrincipal.Current.Identities.First();
                  var Account= CP.Claims.FirstOrDefault(p =&gt; p.Type == ClaimTypes.UserData);
                  return Account.Value;
              }
              set
              {
                  var CP = ClaimsPrincipal.Current.Identities.First();
                  var AccountNo= CP.Claims.FirstOrDefault(p =&gt; p.Type == ClaimTypes.UserData).Value;
                  CP.RemoveClaim(new Claim(ClaimTypes.UserData,AccountNo));
                  CP.AddClaim(new Claim(ClaimTypes.UserData, value));
              }
  
          }
  </code></pre>
  <p>when i try to remove the claim, I get this exception:</p>
  <blockquote>
  <p>The Claim
  'http://schemas.microsoft.com/ws/2008/06/identity/claims/userdata:
  101' was not able to be removed.  It is either not part of this
  Identity or it is a claim that is owned by the Principal that contains
  this Identity. For example, the Principal will own the claim when
  creating a GenericPrincipal with roles. The roles will be exposed
  through the Identity that is passed in the constructor, but not
  actually owned by the Identity.  Similar logic exists for a
  RolePrincipal.</p>
  </blockquote>
  <p>How does one remove and update the Claim?</p>