TL;DR: Automated provisioning and deprovisioning via SCIM helps keep application access aligned with Google Workspace or Entra changes, while WorkOS’ tutorial shows how events, webhooks, and directory sync keep user state current and auditable. Manual account handling is still where delays and access gaps start.
At a glance
What this is: This tutorial shows how to sync directory users into an app with SCIM, directory events, and automated provisioning so access reflects identity-provider changes in near real time.
Why it matters: It matters because IAM teams need provisioning and deprovisioning to follow lifecycle changes across human and non-human identities, not sit behind manual operations that create stale access and audit gaps.
👉 Read WorkOS's tutorial on syncing Google Workspace users into a Ruby app
Context
SCIM is the control plane for automated user provisioning, but the real governance issue is lifecycle drift: access must change when the source directory changes. In enterprise apps, delays between directory updates and application state create overprovisioning, orphaned accounts, and avoidable support overhead.
For IAM teams, the key question is not whether SSO works but whether joiner, mover, and leaver events propagate cleanly into the application. This same lifecycle logic also matters for service accounts and other non-human identities, because stale access becomes a privilege retention problem regardless of who or what holds the account.
Key questions
Q: How should security teams implement automated user provisioning in enterprise apps?
A: Security teams should connect the application to the authoritative directory, map create update and delete events into account state, and verify that changes propagate without manual intervention. The control objective is lifecycle alignment, not just smoother onboarding. That means testing joiner, mover, and leaver flows end to end and confirming the app reflects the directory state after each change.
Q: Why do manual provisioning processes create IAM risk?
A: Manual provisioning creates risk because access changes lag behind identity changes. Every delay increases the chance of stale accounts, excess permissions, or broken offboarding. In enterprise environments, that delay also weakens audit evidence because no one can easily prove that account state matched the source directory at the moment the change happened.
Q: How do organisations know whether directory sync is actually working?
A: They should compare the source directory and the application after provisioning, updates, and deprovisioning events, then verify that no orphaned accounts or mismatched group memberships remain. A working sync is one that converges quickly, preserves order, and survives failures without losing identity state. Reconciliation tests are the clearest signal.
Q: Who is accountable when an application keeps access after a user leaves the directory?
A: The accountable party is the team responsible for identity lifecycle integration, because the failure is a governance failure, not just a technical one. If offboarding does not reach the app, the organisation has not enforced leaver control. That gap should be tracked through access review, incident response, and application ownership processes.
Technical breakdown
SCIM event sync and directory state propagation
SCIM turns identity changes in a directory into structured provisioning events that an application can consume. In this tutorial, directory sync covers user created, updated, deleted, and group membership changes, then maps them into application state. That matters because the app is not supposed to infer change from login activity. It should accept authoritative lifecycle events from the directory and reconcile them in order, so access reflects current entitlement state rather than old cached state.
Practical implication: Treat the directory as the source of truth and design your app to process lifecycle events, not just authentication events.
Events API versus webhook delivery for provisioning
The article contrasts two sync patterns: polling an events API or receiving webhooks. The architectural difference is operational control. An events API gives ordered, replayable, cursor-based processing, which is easier to reconcile and audit. Webhooks are faster but depend on exposed endpoints, signature validation, retry handling, and protection against out-of-order delivery. For provisioning systems, that distinction is crucial because the failure mode is not just missed data, it is inconsistent identity state across systems.
Practical implication: Prefer replayable event consumption when you need stronger recovery, ordering, and auditability than webhook delivery can reliably provide.
Secret handling and webhook integrity in directory sync
The tutorial also shows that provisioning systems depend on more than directory logic. They need API keys, client IDs, and webhook secrets stored as managed secrets, plus HMAC-based verification of incoming webhook traffic. Those controls protect the sync channel itself. If they are weak, an attacker can tamper with provisioning data, inject false lifecycle events, or abuse leaked credentials to read directory state. In identity terms, the sync channel becomes part of the trust boundary.
Practical implication: Protect provisioning credentials and verify every inbound event before allowing it to change application identity state.
Breaches seen in the wild
- Cisco DevHub NHI breach — IntelBroker exploited exposed Cisco credentials, API tokens and keys in DevHub.
- Salesloft OAuth token breach — hackers stole OAuth tokens to access Salesforce data via Salesloft.
Read our 52 NHI Breaches Analysis report for a comprehensive view of breaches impacting Non-Human Identities including AI Agents.
NHI Mgmt Group analysis
Automated provisioning is lifecycle governance, not a convenience feature: The article is really about how application access should follow authoritative identity state, not local admin decisions. SCIM and directory events reduce the time between a directory change and an application change, which is where many access gaps begin. That makes provisioning part of joiner, mover, and leaver control, not a separate integration task. Practitioners should treat it as lifecycle enforcement.
Provisioning drift is a standing access risk because manual steps do not scale with enterprise identity changes: The core problem is not missing code, it is delayed propagation. When an account remains active after the upstream identity has changed, the application is already behind the governance source of truth. That is the same control failure pattern that drives privilege creep and orphaned access across IAM programmes. Practitioners need to measure state convergence, not just whether the sync exists.
Event ordering and replayability are the hidden governance differentiators: The distinction between an ordered events API and webhook delivery is more than implementation detail. Ordered, replayable processing supports reconciliation and audit evidence, while unordered delivery increases the chance of partial state. In identity governance terms, the control is not merely receiving events, but proving that every lifecycle change was applied once and in sequence. Practitioners should align transport choice with audit and recovery requirements.
Secret exposure in provisioning pipelines creates a trust boundary problem, not just a configuration problem: SCIM integrations rely on API keys, client IDs, and webhook verification secrets that sit adjacent to identity state. The article shows that provisioning is only as trustworthy as the secrets protecting its channel. When those credentials are weakly managed, the sync layer itself can become an attack surface. Practitioners should treat provisioning secrets as governance assets, not developer convenience data.
From our research:
- Organisations maintain an average of 6 distinct secrets manager instances, creating fragmentation that undermines centralised control, according to The State of Secrets in AppSec.
- The average estimated time to remediate a leaked secret is 27 days, despite 75% of organisations expressing strong confidence in their secrets management capabilities.
- That gap between confidence and operational reality is why NHI Lifecycle Management Guide becomes the more relevant next step for teams building provisioning controls.
What this signals
Provisioning speed is becoming a governance signal, not an implementation detail: As applications rely more on directory events, the time between upstream identity change and downstream state convergence becomes a measurable control. Teams should watch for orphaned access, delayed deprovisioning, and inconsistent group membership as indicators that lifecycle governance is drifting out of sync.
Secret sprawl inside integration pipelines is now part of identity risk management: Directory sync depends on API keys, webhook secrets, and admin credentials that must be governed like any other sensitive control asset. With 6 distinct secrets manager instances on average, fragmentation can undermine the very provisioning path meant to reduce access risk. Teams should expect secrets governance and lifecycle automation to converge.
The strongest programmes will connect provisioning telemetry to identity governance reporting, so failures in deprovisioning, event ordering, and secret handling are visible at the same management layer. That makes lifecycle monitoring a shared concern for IAM, platform security, and application owners.
For practitioners
- Map provisioning to lifecycle ownership Assign explicit ownership for joiner, mover, and leaver propagation into the application so directory changes are not dependent on ad hoc admin work. Review who can create, update, and deactivate accounts, then tie those actions to upstream directory events rather than local requests.
- Prefer replayable event processing Use an ordered events API and cursor persistence where reconciliation, auditability, and recovery matter more than immediate push delivery. Store the last processed event ID, reprocess safely after failures, and validate that the application state matches the directory state after each batch.
- Secure the provisioning trust channel Store API keys, client IDs, and webhook secrets as managed secrets, then verify HMAC signatures before any inbound payload can change account state. Limit webhook endpoints to the event types the integration actually needs and reject unsigned or malformed requests.
- Test deprovisioning as a first-class control Validate that user deletion and group removal actually remove access in the application, not just mark the user inactive in the directory. Include leaver tests in every integration check so stale entitlements do not survive the upstream identity change.
Key takeaways
- Automated provisioning turns directory changes into enforceable application state, which is the core requirement for clean joiner, mover, and leaver governance.
- The main risk is not the SCIM concept itself but the gap between authoritative identity change and the app state that lags behind it.
- Teams should measure reconciliation, secure provisioning secrets, and test deprovisioning as a control, not as a deployment step.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Non-Human Identity Top 10 address the attack and risk surface, while NIST CSF 2.0 and NIST Zero Trust (SP 800-207) set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-03 | The article centers on provisioning and deprovisioning lifecycle control. |
| NIST CSF 2.0 | PR.AC-1 | Identity and access management depends on accurate lifecycle propagation. |
| NIST Zero Trust (SP 800-207) | AC-2 | Continuous access enforcement requires state alignment across systems. |
Treat directory sync as an access governance control and test that entitlements change with source identity state.
Key terms
- SCIM: System for Cross-domain Identity Management is the standard protocol used to automate user and group lifecycle changes between a directory and an application. It reduces manual account handling by carrying create, update, and delete events into downstream systems in a structured way.
- Directory Sync: Directory Sync is the process of keeping application accounts aligned with an upstream identity directory. In practice, it means lifecycle changes in the source system flow into the app so that access, group membership, and account state do not drift away from authoritative records.
- Lifecycle propagation: Lifecycle propagation is the movement of joiner, mover, and leaver changes from the source identity system into downstream applications. Strong propagation reduces orphaned accounts and stale access, and it is only reliable when the sync path is ordered, replayable, and tied to clear ownership.
- Webhook verification: Webhook verification is the check that confirms an inbound event really came from the expected sender before the payload is trusted. For identity integrations, it protects provisioning flows from forged or tampered requests and preserves the integrity of account changes.
Deepen your knowledge
SCIM provisioning and lifecycle governance are core topics in our NHI Foundation Level course, the industry's only accredited NHI security programme. If you are building identity sync controls for enterprise apps, it is worth exploring.
This post draws on content published by WorkOS: How to sync users from Google Workspace to a Ruby on Rails app using WorkOS. Read the original.
Published by the NHIMG editorial team on 2025-08-01.
NHI Mgmt Group — the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org