skoruba / Duende.IdentityServer.Admin

The administration for the Duende IdentityServer and Asp.Net Core Identity ⚡
Apache License 2.0
549 stars 194 forks source link

User.IsInRole must be true for one of the following roles: (MyRole) #158

Closed apetrut closed 1 year ago

apetrut commented 1 year ago

Hi @skoruba ,

I am getting Access Denied when I click the "Admin" button to load the Administration UI.

image

I added the role claims in the JWT token from a custom ProfileService. However, I checked the JWT token and it contains the "MyRole" id:

image

The role in AspNetRoles table looks like this:

8a7173f8-4502-4967-97e6-b0ae5046d267 MyRole MYROLE ab049d00-a858-46b6-8891-a7284d830057

Can you confirm this is the correct role for Administration? Is there any other setting that needs to be done?

Thanks.

apetrut commented 1 year ago

Closed as it seems I needed the role names in the claim list instead of the role ids.