-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Labels
Pri3Indicates issues/PRs that are low priorityIndicates issues/PRs that are low priorityarea-System.SecurityIssues related to security practices for .NET developers.Issues related to security practices for .NET developers.untriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner
Description
Type of issue
Code doesn't work
Description
I have a JWT that looks like this:
{
"aud": "xxx",
"iss": "https://login.microsoftonline.com/xxx/v2.0",
...,
"azp": "xxx",
"roles": [
"my_role"
],
...
"ver": "2.0"
}
This token is processed by the Azure Application Service Authentication layer and I can see the "roles" claim defined in my ClaimsPrincipal. Therefore when I run:
HttpContext.User.IsInRole("my_role");
I was expecting this to return true but it returns false. It's not really clear in the docs why this wouldn't work.
Page URL
Content source URL
https://github.com/dotnet/dotnet-api-docs/blob/main/xml/System.Web.Security/RolePrincipal.xml
Document Version Independent Id
adcabe65-9e9e-0eb4-20fc-766acfea926e
Article author
Metadata
Metadata
Assignees
Labels
Pri3Indicates issues/PRs that are low priorityIndicates issues/PRs that are low priorityarea-System.SecurityIssues related to security practices for .NET developers.Issues related to security practices for .NET developers.untriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner