Keycloak Policy enforcer supposed to work with Client Roles / Resource_access.{client-id}.roles? #28989
Replies: 4 comments 1 reply
-
/cc @pedroigor, @sberyozkin |
Beta Was this translation helpful? Give feedback.
-
Thanks @StephenOTT for opening the discussion here, @pedroigor Can you clarify please ? |
Beta Was this translation helpful? Give feedback.
-
@StephenOTT, once thing I can definitely confirm is this one:
Do you have Thanks |
Beta Was this translation helpful? Give feedback.
-
@StephenOTT You can use client roles in role-based policies [1]. Or am I missing something? [1] https://www.keycloak.org/docs/latest/authorization_services/index.html#_policy_rbac |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Continuation of #28965
Previous message from 28965:
Description
Based on some testing, (unless I have a config incorrect, but is difficult to tell give the complexities), the Policy Enforcement for Keycloak quarkus-keycloak-authorization works with Realm Roles, but is it also supposed to work with Client Roles that appear under the
resource_access.{client-id}.roles
path in the JWT?I just get 403 responses when trying to use Resource access. I update the roles path as well to:
quarkus.oidc.roles.role-claim-path=resource_access/backend-service/roles
but this did not seem to work.Is there any example of this usage?
What i have found is required to make PEP work with regular roles is something like:
and authorization config:
I am using
quarkus-hibernate-reactive-rest-data-panache
to generate the endpointsAssuming that you want to centralize control of endpoints using Keycloak, Is quarks key cloak authorization setup /tested against using resource_access roles? From my testing above, it did not seem to work, but did work for roles that were Realm Roles.
Beta Was this translation helpful? Give feedback.
All reactions