I'm trying to create a UMS that uses the Keycloak's REST API. Some users will be users
and some other managers
. To differentiate them, they'll belong to different groups and they'll inherit a different set of roles.
All of the users will have a custom attribute named locale
. What I'm trying to achieve on this point, is every time a manager tries to fetch the list of users using the REST API ex. {{keycloak_url}}/admin/realms/{{realm}}/users
only users with the same custom attribute locale
should return.
example:
Complete list of users:
USERNAME LOCALE
manager1 en
manager2 fr
user1 en
user2 en
user3 fr
manager1
requests the users list expected result:
USERNAME LOCALE
manager1 en
user1 en
user2 en
manager2
requests the users list expected result:
USERNAME LOCALE
manager2 fr
user3 fr
Any suggestions on how to achieve this using Keycloak?
Thanks in advance.