I'm using Microsoft Identity 3. I can access the claims of the current user. But I can't figure out how to do the same for another user.
For the current user, inside the controller, I can access the claims collection via:
IEnumerable<Claim> claims = User.Claims;
I can see all the user claims and I can add a claim as follows:
var user = await GetCurrentUserAsync();
await _userManager.AddClaimAsync(user, new Claim("role", "manager"));
But if I do this:
IdentityUser user = await _userManager.FindByIdAsync(userid);
"user" has a "Claims" collection but the count is zero and the collection is empty. How can I access the claims of other than the current user and be able to add and delete claims?