-
|
Hi, when catching user change events, I'm trying to resolve all the clients a user is related to, either through groups or through role mappings directly. So far I have this: So I get the roles (of type RoleModel), but there is no link between the role and the client in those objects. In the database the role is directly linked to the client, but not in the model. Is there some way that I can get the clients for these roles without having to write an sql query? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Looking at the
|
Beta Was this translation helpful? Give feedback.
Looking at the
org.keycloak.models.jpa.RoleAdapterI found out that:containerIdis actuallyclientId(which maps to the client.id in the database - not client.clientId) when the role is a client role.Once you know that, you can use
val client = realm.getClientById(it.key)to get the client.