Repository navigation
Keycloak 26.6 - How to configure realm roles using new feature Organization Groups? #48061
Bug / Missing Feature: No API endpoint to assign role mappings to Organization Groups (introduced in 26.6.0)Keycloak version: 26.6.0 DescriptionKeycloak 26.6.0 introduced support for organization-specific group hierarchies, allowing each organization to manage its own isolated groups. However, there is no clear or documented way to assign role mappings to these organization groups — neither via the Admin REST API nor via the Admin UI. Steps to ReproduceVia Admin REST API
Actual BehaviorREST API: The following error is returned when calling the standard Groups role-mappings endpoint: HTTP 400 Bad Request {
"errorMessage": "Cannot manage organization related group via non Organization API."
}Questions
|
Replies: 2 comments
|
Short version: on 26.6.x this isn't possible. From 26.7.0 it is, through the Organization API. On 26.6.x it's a missing feature, not a decision about roles:
26.7.0 added it (issue #47327, PR #48670, release notes: "Automatic role inheritance through organization groups"). Role mappings now live under the Organization API and accept realm and client roles: The body is the usual list of role representations ( Until you can upgrade: assign the roles directly to the users, or use a realm group or composite role. |
|
@zuhairhalawa has this right. Organization groups gained realm and client role assignment in 26.7.0 ("Automatic role inheritance through organization groups", #47327), exposed as role-mappings on the organization group endpoint, with roles flowing into realm_access / resource_access for all group members. The Organization Group Membership mapper can also surface them inside the organization claim via Add group role mappings. On 26.6.x it genuinely wasn't possible. That was a known gap, not a design decision about roles. Marking this answered. |
Short version: on 26.6.x this isn't possible. From 26.7.0 it is, through the Organization API.
On 26.6.x it's a missing feature, not a decision about roles:
GroupsResource#getGroupByIdrejects organization groups with the 400 you saw. That isolation is intentional and still present in 26.8, so/groups/{id}/role-mappingswill never work for them.OrganizationGroupResourcehas norole-mappingssub-resource, and the admin console hides the Role mapping tab for org groups.26.7.0 added it (issue #47327, PR #48670, release notes: "Automatic role inheritance through organization …