The Realm and client level role restriction

Hello,I am using keycloak version : 25.0.1. I want to achieve a use case for realm and client-level roles.
I have created realm-level roles in realm1, such as: role1, role2, and role3. Within realm1, I have clients like client1, client2, and client3.

My requirement is that when creating client-level roles in any of the above clients, it should only allow me to create roles that already exist in realm1. If I attempt to create a new role (role4) that doesn’t exist in realm1, it should restrict me from creating that role in any of the clients within realm1.

Is it possible to achieve this through some UI configuration, or would adding a custom jar be necessary for this use case?

1 Like