Disabling a departed employee inside Okta or Microsoft Entra ID only blocks their next SSO login—it does nothing to kill active SaaS sessions, 30-day refresh tokens, personal API keys, or idle seat licenses. These lingering ghost accounts are one of the fastest-growing causes of SOC 2 audit failures and post-termination insider data exfiltration.
Key Takeaways
- SSO federation alone cannot terminate existing application sessions or reclaim paid seats when an employee is offboarded in HR or the corporate IdP.
- SCIM 2.0 (RFC 7643 and RFC 7644) pushes authoritative create, update, group-membership, and deactivation events out of band within seconds of directory changes.
- Deprovisioning must differentiate between suspend, revoke, and delete actions so compliance audit logs and historical resource ownership stay intact.
- True offboarding security couples SCIM active=false transitions directly to an immediate session and refresh-token kill-switch.
Why SSO Alone Leaves Ghost Accounts Open After Termination
Many SaaS engineering teams assume that once an enterprise customer connects Okta SAML or Microsoft Entra ID OIDC, employee offboarding is solved automatically. That assumption breaks down immediately under incident analysis. When HR terminates an employee at 10:00 AM and IT suspends their corporate directory account at 10:02 AM, the identity provider sends zero notification to downstream SaaS applications unless automated lifecycle provisioning is active.
As long as the former employee holds an unrevoked browser cookie, a mobile app refresh token, or an OAuth API token inside your SaaS, they can continue reading records, exporting CSVs, and calling APIs for days or weeks. Even after the session expires, their user row remains active in your database—continuing to consume a paid seat, appearing in mention picklists, receiving automated report emails, and failing quarterly SOC 2 CC6.2 user-access recertification audits.
- Browser sessions and sliding refresh tokens routinely persist 7 to 30 days after an upstream SAML or OIDC IdP disables the user.
- Personal Access Tokens (PATs), webhook secrets, and service credentials created by the departed user continue authenticating API requests indefinitely unless cascaded.
- Orphaned accounts inflate customer SaaS seat bills and expose confidential notifications sent via email digests or Slack integrations.
- Manual offboarding tickets sent to SaaS support teams average days of turnaround latency and fail enterprise SLA requirements.
Inside SCIM 2.0: RFC 7643 Schemas and RFC 7644 Operations
System for Cross-domain Identity Management (SCIM 2.0) standardizes user and group lifecycle automation over JSON and HTTPS. RFC 7643 defines the canonical User and Group resource schemas—including immutable identifiers (id and externalId), multi-valued emails, names, active status booleans, and enterprise user extensions—while RFC 7644 defines the RESTful protocol operations for querying, creating, replacing, patching, and deleting records.
In real-world enterprise deployments, Okta, Microsoft Entra ID, JumpCloud, Rippling, and OneLogin exhibit subtle dialect differences that trip up naive SCIM servers. For example, Entra ID frequently sends PATCH operations with capitalized operation names (Replace instead of replace) and path-less object values, while Okta filters users with eq queries on userName and uses PATCH active=false rather than HTTP DELETE for soft deprovisioning. A production-ready SCIM server must handle these RFC edge cases gracefully and scope every endpoint to a specific connection and Bearer token.
- Expose connection-scoped SCIM base URLs (such as /api/scim/v2/connections/{connectionId}) protected by high-entropy, rotatable per-connection Bearer tokens.
- Implement case-insensitive PATCH op parsing (add, remove, replace) and support both path-targeted and value-map PATCH payloads to satisfy both Okta and Entra ID.
- Support SCIM filter expressions (userName eq, externalId eq) and standard ServiceProviderConfig, Schemas, and ResourceTypes discovery endpoints.
- Synchronize /Groups alongside /Users so role demotions and department transfers revoke elevated privileges immediately without offboarding the user.
PATCH /api/scim/v2/connections/conn_94a1f8c2/Users/usr_71b2e904-12a4-4f91-8b10-991a0e3241bc HTTP/1.1
Host: api.sso.id
Authorization: Bearer scim_live_9f8a7b6c5d4e3f2a1b0c9d8e7f6a5b4c
Content-Type: application/scim+json
Accept: application/scim+json
{
"schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
"Operations": [
{
"op": "replace",
"path": "active",
"value": false
}
]
}
HTTP/1.1 200 OK
Content-Type: application/scim+json
{
"schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
"id": "usr_71b2e904-12a4-4f91-8b10-991a0e3241bc",
"externalId": "00u4k8x91pL2aBcDe5d7",
"userName": "[email protected]",
"active": false,
"meta": {
"resourceType": "User",
"lastModified": "2026-11-18T10:02:14Z"
}
}
Choosing the Right Deprovisioning Action: Suspend, Revoke, or Delete
Blindly running a SQL DELETE on a user row when SCIM sets active=false is a classic architectural mistake in B2B SaaS. Enterprise customers operate under strict audit retention rules (SOC 2, HIPAA, SOX, FINRA) where historical invoices, pull requests, approval trails, and audit logs must retain foreign-key integrity pointing back to who performed an action three years ago. Hard deletion also breaks re-hire workflows or temporary medical leave reactivations.
Instead, offer explicit per-connection deprovisioning actions: suspend locks authentication and kills active tokens while preserving profile metadata and historical audit references; revoke strips all application sessions, OAuth grants, and group or role bindings while keeping the directory record auditable; and delete permanently removes PII when GDPR erasure or strict non-retention policies apply. Pair the directory state change with an immediate session kill-switch and webhook fan-out to downstream microservices.
- Suspend: disables login, invalidates active browser sessions and refresh tokens, frees billable seat counters, and retains immutable audit attribution.
- Revoke: clears organization roles, group memberships, active sessions, and delegated API tokens while leaving the identity shell intact for reassignment.
- Delete: triggers safe tenant-ownership checks first so removing a sole workspace owner never orphans a live enterprise tenant.
- Re-activation: when SCIM later patches active=true (rehire or leave return), restore access cleanly via current SCIM group assignments rather than stale historical roles.
export async function handleScimUserDeactivation(event: {
tenantId: string;
organizationId: string;
userId: string;
deprovisionAction: "suspend" | "revoke" | "delete";
}) {
// 1. Kill every active SSO session and refresh token immediately
await ssoIdClient.delete(`/api/users/${event.userId}/sessions/revoke-all`);
// 2. Revoke long-lived application API keys and webhook tokens
await apiKeyStore.revokeAllForUser(event.organizationId, event.userId);
// 3. Reassign scheduled jobs or ownership hooks to org fallback owner
await ownershipService.transferAutomatedJobs(event.organizationId, event.userId);
// 4. Emit immutable SIEM audit entry for SOC 2 CC6.2 evidence
await auditLog.record({
eventType: "scim.user.deprovisioned",
actor: "scim_provisioning_engine",
targetUserId: event.userId,
organizationId: event.organizationId,
actionTaken: event.deprovisionAction,
timestamp: new Date().toISOString()
});
}
Hardening SCIM Endpoints and Auditing Sync Reliability
Because a SCIM endpoint carries write authority over user provisioning, group memberships, and administrative role escalation, it represents a high-value privilege boundary. Never share a single global SCIM token across customers or expose unscoped tenant mutations. Bind every SCIM Bearer token strictly to one external connection and Organization boundary so a compromised token from Customer A can never enumerate, modify, or deactivate users belonging to Customer B.
Operational visibility is equally vital. Enterprise IT admins expect deterministic error responses (409 Conflict for duplicate userName collisions, 404 Not Found for stale IDs, 429 Too Many Requests with Retry-After during bulk directory imports) and searchable provisioning logs showing every inbound PUT, PATCH, and DELETE payload. Keeping access token TTLs short (5 to 15 minutes) ensures that once SCIM triggers session revocation, even stateless JWT gateways stop honoring the ex-employee's credentials within minutes.
- Enforce strict tenant and connection scoping on every SCIM Bearer token, paired with zero-downtime token rotation.
- Log every inbound SCIM mutation with correlation ID, source IP, externalId, and resulting role delta for compliance audits.
- Pair SCIM session revocation with short-lived access tokens (5–15 minutes) or real-time token introspection on high-risk endpoints.
- Support both inbound sync (customer IdP to SaaS) and outbound or bidirectional sync where your platform acts as an authoritative directory hub.
Always treat SCIM active=false as an emergency revocation event, not merely a database flag flip. Wire SCIM deactivation directly to DELETE /api/users/{userId}/sessions/revoke-all and invalidate application-specific API keys in the same transactional workflow.
How SSO.ID Automates SCIM 2.0 Offboarding and Live Session Revocation
SSO.ID v2 embeds a full RFC 7643/7644 SCIM 2.0 provisioning engine directly inside every Identity Connection, coupling directory updates from Okta, Entra ID, Rippling, and JumpCloud with real-time session termination.
- ✓Connection-scoped SCIM 2.0 endpoints (https://api.sso.id/api/scim/v2/connections/{connectionId}) supporting inbound, outbound, and bidirectional /Users and /Groups synchronization.
- ✓Configurable automated offboarding actions (suspend, revoke, or delete) executed instantly when an upstream directory patches active=false or deletes a user.
- ✓Real-time Active Session Kill-Switch (DELETE /api/users/{userId}/sessions/revoke-all) and granular device session revocation across every connected application.
- ✓Safe Deletion tenant-ownership verification (GET /api/users/{userId}/tenant-ownership) and on-demand compliance exports (GET /api/compliance/users/{userId}/export).
Frequently Asked Questions
Okta pushes SCIM deactivation requests within seconds of user suspension, and Microsoft Entra ID supports both on-demand provisioning and 40-minute incremental sync cycles. Coupled with SSO.ID session revocation and short access token TTLs, active sessions terminate immediately rather than lingering for weeks.
The IdP sends a PATCH request to /Groups/{groupId} removing the member. SSO.ID immediately recalculates the user's mapped RBAC roles so elevated admin or billing permissions are revoked on the next token refresh without locking the user out of their remaining valid workspaces.
For most B2B SaaS applications, suspend or revoke is strongly preferred over hard delete so audit trails, document ownership, and billing records remain intact. Reserve hard deletion for explicit GDPR right-to-erasure workflows.