Is there a way to assign a group to a user directly in the POST /admin/realms/{realm-name}/users
registration API?
Currently, to assign a user to a group after registration, I have to follow at least 3 steps:
- Call
POST /admin/realms/{realm-name}/users
to create a new user. - Retrieve the
user_id
by callingGET /admin/realms/{realm-name}/users?username=...
. - Retrieve the
group_id
by callingGET /admin/realms/{realm-name}/groups
and searching for the group name. - Finally, use
PUT /admin/realms/{realm-name}/users/{user_id}/groups/{group_id}
to assign the user to the group.
This process involves multiple API calls, making it cumbersome and inefficient, especially in scenarios where users and groups are created dynamically.
➤ Why is it not possible to assign a group directly in the user registration API (POST /users
)?
➤ Is there any roadmap or official workaround that will allow for group assignments during user registration?