Repository navigation
Retrieve Inherited Client Roles of User without Client ID #37139
Unanswered
Geodan-RoemerR
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi There,
I am investigating how to retrieve the inherited client roles of a user. Without knowing any specific client-id. Our use case if a spring boot application with all keycloak users cached. We would like to have all the user roles (inherited and non-inherited) which a user currently has.
In the API documentation there are a few endpoints of interest:
GET /admin/realms/{realm}/users/{user-id}/role-mappingsGET /admin/realms/{realm}/users/{user-id}/role-mappings/realm/compositeBut both these endpoint don't help me actually, since:
the first one returns 1) realm roles, 2) inherited realm roles and 3) client roles but no inherited clientroles.
the second one returns 1) realms roles and 2) inherited realm roles.
we are able to get all inherited clientroles through this endpoint:
GET /admin/realms/{realm}/users/{user-id}/role-mappings/clients/{client-id}/compositebut that requires supplying an cliend-id, something we are not able to.
when F12 while using the keycloak UI, selecting a user and unticking 'Hide inherited roles' a request to this ui-extension endpoint is made which actually contains all the desired roles.
GET /admin/realms/gm/ui-ext/effective-roles/users/{user-id}could anyone explain to me why the
role-mappingsendpoint does not return inherited client roles? is this behavior expected? or could this possibly be a bug? what are some possible suggestion to do get the inherited client roles? or maybe i should file a bug complaint to improve this?would love to hear your opinion.
cheer,
Roemer
All reactions