📅  最后修改于: 2022-03-11 14:48:38.885000             🧑  作者: Mango
var claimNameList = identity.Claims.Select(x => x.Type).ToList();
foreach (var name in claimNameList)
{
if (!name.Equals("UserAccountId") && !name.Equals("Email") && !name.Equals("TenantIds"))
{
var claim = identity.Claims.FirstOrDefault(x => x.Type == name);
if (claim != null)
identity.RemoveClaim(claim);
}
}