Closed BravoJuliett closed 5 years ago
By default, Keycloak returns Roles information within AccessToken.
If you are wondering to fetch Roles (e.g. realm_access roles, resource_access roles etc) within UserInfo endpoint, please make sure that Keycloak returns those claims .
To add these claims to the UserInfo endpoint, edit the roles
settings in the Client Scopes:
Clients Scopes -> roles -> settings:
and in the client roles
mappers settings, an example mapping :
I cannot seem to figure out how to get the user's roles from keycloak is there something I am doing wrong here:
and I get this when I log either roles or profile to console in the first code block:
as you can see roles are no where to be found. Any help would be appreciated. Thanks.