keycloak-ui
keycloak-ui copied to clipboard
role mapping is not working for child-groups
Describe the bug
Using the console, I am not able to set either client or realm role mappings on child groups. (It works well for top-level groups.) REST API is also not working.
Version
19.0.2
Expected behavior
role mappings should be working properly for child-groups
Actual behavior
please see the "Describe the bug" section.
How to Reproduce?
- create a test client (test-client)
- create a test role (test-role) in the test client
- create a group "parent"
- under the "parent" group, create a child group "child-1"
- select group "child-1"
- open tab "Role mapping"
- map previously created client role "test-client"
- refresh the page
- role mapping is not there
Please let me know if you need more details .
Anything else?
REST API is also not working. https://www.keycloak.org/docs-api/19.0.2/rest-api/index.html#_client_role_mappings_resource POST /{realm}/groups/{id}/role-mappings/clients/{client}
I've tried to reproduce this and it working for me. Did you try this with a fresh installation? What database, or relevant config, are you doing? Is this with the new Quarkus dist?
DB is PostgreSQL. Version is 14.3 running on Amazon aurora serverless. It is a fresh installation - Quarkus distribution.
Just tested in "master" realm using "admin". The behavior is the same. As soon as I refresh the page (browser refresh) the roles are gone. Mapping on parent level works. And I see the roles propagated in children groups even though I selected "hide inherited roles". And the role is marked as "Inherited=False".

Could you give it a go with the old admin console:
--features-disabled=admin2
Thank you. Tested in local machine. I can see data in the old console. New console is bahaving badly.
I set role mapping in the NEW console and it dissapeared after the refresh (selected "parent" group and refreshed the page). As soon as I started using OLD console - I was able to see the proper mapping. I also played around assigning and unassigning role as well as refreshing the page - it was stable and worked properly.
Need to figure out why the API did not work. Was there any change in "role-mappings" API?
I will say the API works - the problem was that I was not able to check the resulting mappings in the NEW console. This issue is for UI / New console. Please let me know if you guys need more deatils how to reproduce this behavior.
Thank you Stian for your quick replies !!!
this issue might be fixed in a nightly version. If so, then it will be fixed and released by v20.0.0.
We've discovered the same issue in https://github.com/keycloak/keycloak/discussions/14954. @edewit I can confirm that it is fixed in the nightly build based on https://github.com/keycloak/keycloak/commit/fc7c57ee12c61730bad089b190b5e2e51c24d3e2. Thanks!