Group Sync and Nested Group Flattening in SCIM Deployments

Entra's SCIM feed drops nested members silently, so here are three fixes.

· 8 min read · Updated
Cover illustration for “Group Sync and Nested Group Flattening in SCIM Deployments”
SCIM and Directory Sync · October 23, 2026 · 8 min read · 1,866 words

SCIM group sync and nested-group flattening require an explicit choice about which memberships an application should receive. A directory hierarchy can be lost during provisioning. For deployments to work as expected, teams separate direct membership from inherited access, then use pre-flattening, direct child-group assignment, or transitive reconciliation to send the application a membership model it can use.

What SCIM group sync actually does — and does not — carry across the protocol boundary

SCIM synchronizes user accounts, group memberships, and identity attributes between identity providers and service providers. It is not a directory traversal engine. The protocol transports the membership data an identity provider explicitly sends, without promising to reproduce the source directory’s internal relationship graph. A group relationship and the effective users reachable through that relationship are different information.

Microsoft Entra ID provisions the literal, direct membership of the group assigned to the Enterprise App. If Group A contains Group B and Group B contains Alice, the application receives only Group B as a member of Group A. Microsoft’s provisioning service omits recursive expansion of that relationship as an implementation decision under SCIM, whose specification leaves recursive group expansion optional.

Why the failure is silent and why silence makes it dangerous

WorkOS shows what happens with Company-Engineering-All and the regional groups nested within it, Company-Engineering-UK, Company-Engineering-USA, and Company-Engineering-INDIA. Only the parent’s three direct members synced to the application, leaving it nearly empty while the vast majority of engineers could not log in. Provisioning did not report the missing descendants as errors. The operation succeeded on its own terms, so the access failure became visible only when users needed the application.

The same guide describes a customer expecting a parent/child hierarchy and receiving a flat, undifferentiated list of groups. Authorization assumptions based on inferred nesting no longer held. Another example shows users in the application directory with an empty groups array, so downstream role mapping lacks the membership it needs to grant access. The group object can exist without its intended membership.

For non-human identities, a disappearing group path can leave a service account or automated workflow failing closed in one application while remaining overly privileged in another. Diagnosis should start at the assignment boundary. Teams should check the group assignment in the Enterprise App, see whether the assigned group has child groups, and look for skipped descendants in provisioning logs.

Why the same problem takes different shapes across identity providers

Google Workspace presents nested groups differently from Entra, and some connectors supplement SCIM with Google’s Admin APIs to compute transitive membership. Entra’s SCIM provisioning exposes direct memberships instead. Consequently, an authorization model that works through one connector can fail silently through another, even though both integrations synchronize groups.

Portability requires more than a SCIM support claim. Identity providers differ across schema representation, PATCH semantics, bulk operations, filtering, pagination, and custom attributes. Keycloak’s SCIM Realm API is available as an experimental feature in Keycloak 26.6, illustrating why implementation status deserves attention as well as protocol support. IAM teams should validate connector-specific semantics before treating group-based access as portable or writing onboarding guidance that assumes uniform behavior.

Databricks addresses the nested-group limitation through a separate path. Its automatic identity management uses a non-SCIM approach to handle Microsoft Entra ID service principals and nested groups, which it explicitly identifies as unsupported through SCIM provisioning. That distinction locates the additional capability outside the provisioning protocol. It also makes the design choice visible rather than leaving applications to assume that hierarchy will arrive intact.

Why authorization models that assume inherited membership break at provisioning time

Applications often translate synced groups directly into roles, organizations, or entitlements. When the feed omits users inside child groups, the receiving application acts faithfully on an incomplete membership payload. Large tenants make that distinction difficult to see because regions, teams, and business units may all be expressed through nesting. The authorization decision can be locally correct but operationally wrong.

Timing makes diagnosis harder still. Entra provisioning runs on a sync cycle, so directory changes produce delayed divergences. AWS IAM Identity Center also removes the ability to add or edit users through the AWS console once SCIM is enabled. In that setting, the authoritative provisioning payload cannot be bypassed with a quick manual correction to an underprovisioned user.

The same mismatch undermines recertification campaigns, role assignment audits, and joiner-mover-leaver workflows because they rely on accurate effective membership. NIST SP 800-53 Rev 5 controls AC-2, Account Management, and AC-6, Least Privilege, provide the governance anchor for knowing which identities have access. Teams need to decide whether the consuming application needs effective membership alone or the hierarchy that explains how access was granted.

Three patterns that make SCIM group sync behave predictably

The simplest pattern is to pre-flatten membership into a group set aside for provisioning, such as app-yourapp-users, and add every user who needs access directly to it. It fits a small number of affected groups where IT can adjust Entra membership rules and entitlement outcomes alone meet the application’s needs. Dynamic rules based on attributes such as department == "Engineering" can reduce maintenance. The cost is a parallel source of truth. A new hire who is added to the original nested group but left out of the provisioning group still misses access, and keeping that parallel structure up to date gets harder across dozens of nested groups.

The second pattern assigns each child group directly to the Enterprise App, rather than relying on a top-level assignment to include descendants. Company-Engineering-UK, Company-Engineering-USA, and Company-Engineering-INDIA would each be assigned with the parent, allowing Entra to provision their direct members independently. The application takes the union of those flat memberships to decide who has access. This often fits larger tenants whose applications already have teams or segments, particularly when the parent serves solely as a governance construct. But each new regional group needs its own assignment, so teams have another list to keep up to date.

The third pattern uses SCIM for baseline provisioning and scheduled Microsoft Graph queries to reconcile transitive membership. Graph can return the nested users that SCIM does not expose, allowing the two views to be compared to restore intended access. This fits cases where the hierarchy matters to how things run or auditors need proof of which child group granted access. A flat transitive result is not itself that evidence. The reconciliation design must account for the application’s hierarchy requirements as well as its effective membership set.

Reconciliation adds a second integration and another place where authentication is needed. Its schedule also creates latency between the SCIM view and the reconciled view. The job needs a clear owner, a way to handle exceptions, and a written source of truth for membership changes that says how to resolve conflicts when SCIM and Graph disagree. No pattern is universally preferable. The first decision is whether the application needs effective membership or preserved hierarchy, followed by the scale and ownership constraints that make the chosen approach sustainable.

What to validate before declaring any pattern production-ready

Validation should start with users in child groups as well as direct members. Teams should inspect provisioning logs to compare what Entra sent with what the application received, then test access removal when a user leaves a child group or a child group moves under another parent. A pattern is acceptable only when those changes propagate within the application’s risk tolerance window.

Teams should check that the application accepts PATCH operations because full PUT replacement can drop attributes that are missing from the identity provider’s payload. A “supports SCIM” claim does not establish full RFC 7642, RFC 7643, and RFC 7644 conformance. Evaluation should cover group handling, custom attributes, deprovisioning, and bulk operations, with explicit checks for schema mismatch and partial bulk failures.

Failure testing should include expired-token 401 responses, rate-limit 429 responses, invalid-attribute 400 responses, permission-related 403 responses, network timeouts, and retry behavior. Teams also need drift detection for records changed outside the SCIM pipeline. These exercises belong before production and in repeated validation as either side changes. Simulated HR mass-termination, backoffs, token expiry, and network errors test whether removal remains reliable under stress. For CI/CD workflows that provision ephemeral service accounts, the same scrutiny is necessary to prevent automated creation and teardown from concealing lifecycle gaps.

How local SCIM simulators make nested-group validation repeatable in CI

Testing with a live identity provider is slow, needs credentials, and is hard to repeat across developer environments and CI pipelines. A local testing service can instead act as the identity provider and SCIM client without a real IdP. Its control surface can manage local users and groups, independent credentials, remote IDs, sync state, operation history, and errors. An offline-friendly environment makes those tests repeatable without live credentials or rate limits. It validates the selected pattern with Entra’s nested-group behavior unchanged.

State is essential to that validation. As a user is added, listed, moved into a child group, and the child group is removed, the simulated world must change to match. A stateless mock with canned responses cannot show those changes. Parent/child structures set up in advance with realistic membership counts give the tests enough users and groups to show which descendants are missing. An empty sandbox with a single user cannot expose the nearly empty engineering-all failure shape.

Fault injection should be part of the same testing surface. A service that also tests SAML and OIDC can exercise temporary token outages, slow token endpoints, expired tokens, broken signatures, unsigned tokens, wrong audiences, missing claims, and replayed assertions, together with explicit SCIM failure responses. These conditions test whether sync latency and deprovisioning remain acceptable during failures. For AI agents or automated workflows calling SCIM-provisioned APIs, the same stateful environment can provide deterministic, horizontally scalable testing for agent evaluation and RL environment construction.

Keeping the chosen pattern honest as directories and applications change over time

A working deployment can drift when an IdP changes, an application revises its PATCH handling, or a directory gains new branches. Teams should inventory applications consuming Entra groups through SCIM and flag any dependence on nested or transitive membership. Applications requiring manual recursion or custom provisioning logic should be documented as exceptions, with their extra maintenance obligations visible.

The specification also adds new conformance surfaces. RFC 9865 added cursor-based pagination in October 2025, RFC 9967 added a profile for SCIM events via Security Event Tokens in May 2026, and RFC 9944 added device-schema extensions in May 2026. None addresses nested-group expansion. Continuous verification against the live API is necessary to detect implementation drift, and a simulator needs that verification too. Otherwise, repeatable local tests can provide false confidence about behavior that no longer matches production.

Teams should use evidence from deprovisioning validation in access reviews and change management so that membership changes stay within the application’s risk tolerance window. Privileged inheritance warrants its own review. ISO/IEC 27001:2022 A.8.2 requires teams to limit and manage privileged access rights and review them regularly. Those duties cover the access that the chosen pattern grants as well as the group structure shown in the directory.

Nested-group flattening is a protocol boundary to design around. Group sync becomes predictable when expansion, assignment, or reconciliation explicitly defines what crosses that boundary and who keeps it accurate.

Sources

  1. Understand Azure AD syncing for nested groups

More in SCIM and Directory Sync