You are not adding a role for every element of the array, but you pass the whole array as parameter in Claim() constructor. You have to itterate through the array of roles and create for every single role new claim.
private async void AddCookies(string[] roles)
{
var claims = new List<Claim>();
foreach(var role in roles)
{
var claim = new Claim(ClaimTypes.Role, role);
claims.Add(claim);
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…