This seems like a simple exercise, but I can’t figure out why this is different?
User.HasClaim(System.Security.Claims.ClaimTypes.Role, “AdminRole”)
true
User.IsInRole(“AdminRole”)
false
The above should evaluate to the same result, but it isn't. I'm just using cookies authentication and loading the claims into a claims principle.
This becomes a problem when I try to use the Authorize attribute like [Authorize(Role="AdminRole")], which returns false while having the what seems to be the right role claim.