diff --git a/src/main/java/sh/libre/scim/storage/ScimStorageProviderFactory.java b/src/main/java/sh/libre/scim/storage/ScimStorageProviderFactory.java index a3cf57427a..d961b70032 100644 --- a/src/main/java/sh/libre/scim/storage/ScimStorageProviderFactory.java +++ b/src/main/java/sh/libre/scim/storage/ScimStorageProviderFactory.java @@ -124,6 +124,8 @@ public class ScimStorageProviderFactory @Override public void run(KeycloakSession session) { + var realm = session.realms().getRealm(realmId); + session.getContext().setRealm(realm); var dispatcher = new ScimDispatcher(session); if (model.get("propagation-user").equals("true")) { dispatcher.runOne(model, (client) -> client.sync(UserAdapter.class, result));