Hello,
I’m trying to apply Role Based Authorization in my Blazor WASM SPA. My main use case would be to use the [Authorize(Role = “SomeRole”)] attribute on my components.
For some reason, the Roles I assign to a user don’t appear in the ID Token (as expected), but they don’t appear in the Access Token either.
This is my config in program.cs:
I found the above config here:
I can confirm that the Role has indeed been assigned to the user I’m logged in with.
The Access Token Looks like this:
The ID Token looks like this:
How come the roles do not get passed along with the Access Token?
Note I also enabled the following in the API settings:
As an alternative, it seems like I can use the Permissions from the Access Token instead. Even though I feel like this defeats the purpose of Roles existing out of multiple permissions completely.
I hope someone can help me out here.
Thanks in advance!