title: A claim of type 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier' was not present on the provided ClaimsIdentity
body: <p>i using claim in login . but it show me this error </p>
  
  <blockquote>
    <p>A claim of type <code>http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier</code> was not present on the provided ClaimsIdentity.</p>
  </blockquote>
  
  <p>how solve this ? </p>
  
  <pre><code>public class MvcApplication : System.Web.HttpApplication
  {
      protected void Application_Start()
      {
          AreaRegistration.RegisterAllAreas();
          FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
          RouteConfig.RegisterRoutes(RouteTable.Routes);
          BundleConfig.RegisterBundles(BundleTable.Bundles);
          //AntiForgeryConfig.UniqueClaimTypeIdentifier = ClaimTypes.Email;
          AntiForgeryConfig.UniqueClaimTypeIdentifier = ClaimTypes.NameIdentifier;
      }
  }
  </code></pre>
  
  <p>.</p>
  
  <pre><code>public async Task&lt;ActionResult&gt; Login(LoginViewModel model, string returnUrl)
  {
  
      if (!ModelState.IsValid)
      {
          return View(model);
      }
  
      var identity =new  ClaimsIdentity(new[] { new Claim(ClaimTypes.Name, model.Email) }, DefaultAuthenticationTypes.ApplicationCookie,
          ClaimTypes.Name, ClaimTypes.Role);
      identity.AddClaim(new Claim(ClaimTypes.Name, model.Email));
      identity.AddClaim(new Claim(ClaimTypes.Role, "Admin"));
      identity.AddClaim(new Claim(ClaimTypes.Sid, "123"));
      AuthenticationManager.SignIn(new AuthenticationProperties
      {
          IsPersistent = model.RememberMe
      }, identity);
      return RedirectToLocal(returnUrl);
  }
  </code></pre>
  
  <p><strong>Update</strong></p>
  
  <p><a href="https://i.stack.imgur.com/zlxN4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zlxN4.png" alt="enter image description here"></a></p>