Keycloak organizations invite user and add it to preselected groups

I am currently working with the organizations feature, and I am struggling to find a way to reproduce the behaviour I have using realms.

On my previous flow, from my web UI an admin was able to create a user and select the groups that the new user had to be assigned to. I did this just by first creating the user, then grabbing the userId from the response headers, and finally assigning it to the selected groups.

However, this flow is not what I need with organizations, since I want the new user to be a managed user, so I just want to send him the invite and then he finishes the process from the registration form. I know I could setup a standard group to be assigned to the new users, and after the user has finished the registration process, the admin is able to assign the groups to it, but ideally I would need this to be done somehow in only one step.

Is there a way to send some extra data to the registration event so then I can add a mapper that checks this data and assigns the groups once the user has been created? Or is there any other way I am able to achieve this?

Thanks a lot for any input

This is AFAIK currently not possible ootb. Perhaps one can achieve it with a custom event listener.

Fun fact: organizations are internally in Keycloak special types of groups… :wink:

1 Like