If you are building a B2B SaaS platform, your first enterprise deal usually forces you to implement SAML 2.0 Single Sign-On (SSO).

However, as soon as you move upmarket to regulated FinTech, HealthTech, or Fortune 500 buyers using Okta Workforce or Microsoft Entra ID (Azure AD), their InfoSec team will ask a second question:

"SAML 2.0 logs our employees in. But what happens when we terminate an employee at 2:00 PM while they still have an active 7-day session cookie in your application? Do you support **RFC 7644 SCIM 2.0 automated offboarding (deprovisioning)?"

Why Legacy SCIM 2.0 Implementations Are Broken for Modern SaaS

Historically, adding SCIM 2.0 meant two painful choices:

  1. Paying the $125/Month Per-Directory Broker Tax: Legacy identity brokers charge $125/month per SAML connection plus another $125/month per SCIM directory ($250/month per enterprise customer). For just 5 enterprise customers, you are paying $1,250/month ($15,000/year).
  2. Permanent Third-Party Employee PII Storage (GDPR & HIPAA Liability): Traditional SCIM brokers work by mirroring your customer's entire corporate employee directory (Users and Groups) into a stateful database hosted on the broker's servers. That means a third-party sub-processor is permanently storing thousands of employee emails and names on disk.

Rethinking SCIM 2.0: The 100% Stateless Volatile-RAM Webhook Bridge

When engineering KyoRox v2.5-GA (https://sso.kyorox.com), we asked a simple architectural question:

Why does an identity proxy need to store employee PII on disk at all when an Identity Provider (Okta or Microsoft Entra ID) is already the source of truth?

Instead of a stateful third-party SCIM database, we built a 100% Stateless RFC 7644 SCIM 2.0 Provisioning & Instant Deprovisioning Webhook Bridge (https://sso.kyorox.com/scim/v2/:tenant_id) and included it for FREE ($0 extra) on every KyoRox plan.

How the Stateless SCIM 2.0 Bridge Executes in < 5ms RAM

  1. Deterministic Stateless Bearer Authentication (kyx_scim_...):
    • Every KyoRox tenant receives a SCIM 2.0 Base URL (https://sso.kyorox.com/scim/v2/{TENANT_UUID}) and an OAuth Bearer Token derived deterministically via HMAC-SHA256 from their AES-256-GCM encrypted vault secret.
    • When Okta, Microsoft Entra ID, JumpCloud, or OneLogin calls /scim/v2/:tenant_id/Users or /Groups, KyoRox verifies the Bearer token in volatile RAM using constant-time comparison (crypto.timingSafeEqual).
  2. Volatile RAM RFC 7644 Translation:
    • Employee Terminated / Deactivated (PATCH /Users/:id with active: false or DELETE /Users/:id): The moment an IT admin deactivates a user in Okta or Entra ID, KyoRox parses the RFC 7644 PatchOp in volatile RAM (< 5ms) and dispatches an HMAC-SHA256 signed scim.user.deprovisioned webhook to your backend.
    • New Employee Provisioned (POST /Users): Normalizes userName, primary work email, givenName, familyName, and externalId in RAM and dispatches scim.user.provisioned.
    • Security Group Push (POST / PATCH /Groups): Normalizes group display names and member arrays into scim.group.synced.
  3. Zero Bytes Written to Disk:
    • As soon as the signed webhook is dispatched and the RFC 7644 JSON response (200 OK / 201 Created / 204 No Content) is returned to Okta/Entra ID, the memory buffer is garbage-collected. 0 bytes of employee PII are ever stored in KyoRox's database.

Code Walkthrough: Handling Instant SCIM 2.0 Session Revocation in Node.js & Python

Every outbound webhook from KyoRox includes:

  • X-KyoRox-SCIM-Event: scim.user.deprovisioned | scim.user.provisioned | scim.user.updated | scim.group.synced
  • X-KyoRox-SCIM-Signature: t=<unix_timestamp>,v1=<hmac_sha256_hex> (signed with your 256-bit KYOROX_JWT_SECRET)

1. Node.js / Express Webhook Handler (Instant Session Kill)

import crypto from "node:crypto"; export async function handleKyoRoxScimWebhook(req, res) { const rawBody = JSON.stringify(req.body); const sigHeader = String(req.headers["x-kyorox-scim-signature"] || ""); const [tPart, v1Part] = sigHeader.split(","); const ts = tPart ? tPart.replace("t=", "") : ""; const providedSig = v1Part ? v1Part.replace("v1=", "") : ""; const expectedSig = crypto .createHmac("sha256", process.env.KYOROX_JWT_SECRET) .update(`${ts}.${rawBody}`, "utf8") .digest("hex"); if (!providedSig || expectedSig !== providedSig) { return res.status(401).json({ error: "Invalid SCIM webhook signature" }); } const { event_type, data } = req.body; if (event_type === "scim.user.deprovisioned") { // Employee was deactivated or unassigned in Okta / Microsoft Entra ID! // Immediately revoke their active session cookies and refresh tokens: await db.sessions.deleteMany({ where: { userEmail: data.email } }); await db.users.update({ where: { email: data.email }, data: { active: false } }); } else if (event_type === "scim.user.provisioned") { await db.users.upsert({ where: { email: data.email }, update: { active: true, firstName: data.given_name, lastName: data.family_name }, create: { email: data.email, active: true, firstName: data.given_name, lastName: data.family_name } }); } return res.status(200).json({ status: "scim_event_applied" }); } 

2. Python / FastAPI Webhook Handler

import os, hmac, hashlib, json from fastapi import FastAPI, Request, HTTPException app = FastAPI() KYOROX_JWT_SECRET = os.environ["KYOROX_JWT_SECRET"] @app.post("/webhooks/kyorox-scim") async def handle_kyorox_scim(request: Request): raw_body = (await request.body()).decode("utf-8") sig_header = request.headers.get("x-kyorox-scim-signature", "") parts = dict(p.split("=", 1) for p in sig_header.split(",") if "=" in p) expected = hmac.new( KYOROX_JWT_SECRET.encode("utf-8"), f"{parts.get('t', '')}.{raw_body}".encode("utf-8"), hashlib.sha256 ).hexdigest() if not hmac.compare_digest(expected, parts.get("v1", "")): raise HTTPException(status_code=401, detail="Invalid SCIM signature") event = json.loads(raw_body) if event["event_type"] == "scim.user.deprovisioned": # Terminate active user sessions immediately user_email = event["data"].get("email") # await revoke_user_sessions(user_email) return {"received": True} 

Built-In 1-Click SCIM 2.0 Simulator in the KyoRox Control Plane

You don't even need an active Okta or Entra ID developer tenant to test your webhook code. Inside the KyoRox Customer Control Plane (under the SCIM 2.0 Directory Bridge tab), you can paste your HTTPS webhook URL and click "Simulate Employee Deprovisioned (Kill Session)" to fire a real signed webhook payload and inspect the response in your browser.

Summary: SAML 2.0 + SCIM 2.0 Without the $250/Customer Tax

Plan Tier Monthly Flat Price Included SAML 2.0 IdPs Included Stateless SCIM 2.0 Bridges Monthly Active User (MAU) Tax
Starter Plan $39 / month 1 Active SAML 2.0 IdP 1 Stateless SCIM 2.0 Bridge ($0 Extra) $0 Forever (Unlimited Users)
Growth Plan $139 / month Up to 5 SAML 2.0 IdPs Up to 5 Stateless SCIM 2.0 Bridges ($0 Extra) $0 Forever (Unlimited Users)
Enterprise Plan $349 / month Up to 999 SAML 2.0 IdPs Up to 999 Stateless SCIM 2.0 Bridges ($0 Extra) $0 Forever (Unlimited Users)