diff --git a/src/main/java/sh/libre/scim/event/ScimEventListenerProvider.java b/src/main/java/sh/libre/scim/event/ScimEventListenerProvider.java index 95efe5aa7b..0d98404df6 100644 --- a/src/main/java/sh/libre/scim/event/ScimEventListenerProvider.java +++ b/src/main/java/sh/libre/scim/event/ScimEventListenerProvider.java @@ -54,6 +54,9 @@ public class ScimEventListenerProvider implements EventListenerProvider { if (event.getOperationType() == OperationType.CREATE) { var user = getUser(userId); dispatcher.run(ScimDispatcher.SCOPE_USER, (client) -> client.create(UserAdapter.class, user)); + user.getGroupsStream().forEach(group -> { + dispatcher.run(ScimDispatcher.SCOPE_GROUP, (client) -> client.replace(GroupAdapter.class, group)); + }); } if (event.getOperationType() == OperationType.UPDATE) { var user = getUser(userId);