I am trying to map groups assigned to a user to a claim in the JWT provided by keycloak when signing in. I create the mapping under client -> client scopes -> client-dedicated. I create a new mapper from the predefined mappers. In the list I select groups.
It also says here that user realm roles are going to be mapped to the claim. In my understanding this is wrong but I am very new to KeyCloak. Subsequently the new claims in my token are the realm roles and not the groups my user is a member of.
These seem to be realm roles and not my groups:
I am using KeyCloak version 22.0.5. Maybe a bug, maybe my understanding of groups is wrong.