get claims from jwt token middleware .net framework
OnUserInformationReceived = context =>
{
var admins = new string[]
{
"[email protected]",
"{your email address here}"
};
var additionalClaims = new List<Claim>();
if (admins.Contains(context.Principal.FindFirstValue("email")))
{
additionalClaims.Add(new Claim("role", "Admin"));
}
var newIdentity = new ClaimsIdentity(context.Principal.Identity, additionalClaims, "pwd", "name", "role");
context.Principal = new ClaimsPrincipal(newIdentity);
return Task.CompletedTask;
},