Skip to content
Running AI in production· Guide 11 of 14Intermediate9 min readUpdated

SSO vs SCIM ​

Single sign-onSSO: Single sign-on: people sign in once with their organization's identity provider and reach many apps without a separate password for each. and SCIMSCIM: System for Cross-domain Identity Management: a standard HTTP and JSON protocol an identity provider uses to create, update and deactivate user accounts and groups in other apps. solve different problems, and an AI platform that many people use needs an answer to both. SSO, through OpenID ConnectOIDC: OpenID Connect: an identity layer on top of OAuth 2.0 that adds a signed ID token, so an application can learn who signed in at an identity provider, not just get access to an API. or SAML 2.0SAML: Security Assertion Markup Language: an older XML-based standard for single sign-on, where the identity provider sends a signed assertion about the user., answers "who is this person, right now?" each time someone signs in. SCIM, the System for Cross-domain Identity Management, answers "which accounts and groups should exist in this app?" by letting your identity provider create, change and deactivate them over HTTP, whether or not anyone is signing in. SSO alone handles joiners well: an account can be created on the first sign-in. It does not handle leavers. Disabling someone in the directory stops their next sign-in. Unless the app and the provider both support single logout, it does not end the sessions they already hold, and it never removes the account or revokes the API keys they created. Removing those is provisioning. SCIM is the standard way for the identity provider to tell the app, and a well-built app then ends the sessions and keys too.

Two questions, two protocols ​

SSO (OIDC or SAML)SCIM 2.0
Question it answersWho is signing in, and how did they prove it?Which users and groups should exist, with which attributes?
When it runsAt sign-in, with the person presentWhenever the directory changes, with nobody present
Who starts itThe person's browser, redirected between app and identity providerThe identity provider (the SCIM client), calling the app's API
What travelsAn ID token (a signed JWT) or a signed XML assertionJSON resources: User and Group, over HTTP
DirectionIdentity provider to app, through the browserIdentity provider to app, server to server
StandardsOpenID Connect Core 1.0; SAML 2.0 (OASIS)RFC 7643 (schema) and RFC 7644 (protocol), IETF 2015
What it cannot doRemove an account or revoke API keys; ending existing sessions needs a logout extension both sides supportAuthenticate anyone
The SSO path and the SCIM pathAn identity provider on the left and an app on the right. The SSO path goes up through the person's browser at sign-in and carries an ID token or assertion. The SCIM path goes straight from the identity provider to the app's SCIM API and carries user and group changes when the directory changes.Your identity providerApp (AI platform)Person's browserSSO: token or assertion, at sign-inSCIM: POST, PATCH, DELETE on /Users and /Groupssent when the directory changes, nobody signing in
SSO goes through the browser while a person signs in. SCIM goes straight from the identity provider to the app, at any time.

What SSO does, and where it stops ​

With OIDC, the app redirects the browser to the identity provider, the person signs in there, and the app receives an ID token: in the words of the specification, "a security token that contains Claims about the Authentication of an End-User", represented as a JSON Web Token. With SAML, the identity provider posts a signed assertion back through the browser. Either way the app learns who the person is, and often their email and groups, at that moment.

Many apps use this to create accounts on demand. The first time someone signs in, the app creates an account from the token's claims, a pattern usually called just-in-time provisioning. Groups in the token can set the account's role on each sign-in. That covers joiners and many role changes, with nothing extra to run.

The gaps show between sign-ins:

  • Leavers. When someone leaves, the identity provider stops issuing tokens for them. The app only notices if they try to sign in again. A session cookie issued yesterday still works until it expires. API keys the person created never pass through SSO at all.
  • Removed groups. If a person moves out of the admins group, the app sees it on their next sign-in, if it re-reads groups and is willing to lower a role. Until then they keep the old role.
  • Accounts that never sign in. An app that should list a team before its members first sign in, for example to assign them to projects or approvals, has nothing to list.

What SCIM does ​

SCIM 2.0 is two IETF documents. RFC 7643 defines the schema: it "provides a platform-neutral schema and extension model for representing users and groups". A user is identified by the schema urn:ietf:params:scim:schemas:core:2.0:User, a group by urn:ietf:params:scim:schemas:core:2.0:Group, and an enterprise extension adds fields such as department and manager. RFC 7644 defines the protocol, "an HTTP-based protocol that makes managing identities in multi-domain scenarios easier to support via a standardized service."

The app (the service provider) exposes endpoints such as /Users, /Groups, /Schemas, /ResourceTypes and /ServiceProviderConfig. The identity provider (the SCIM client) calls them:

  • POST /Users creates an account for a new hire.
  • GET /Users?filter=... finds an existing one, for example by userName.
  • PATCH changes part of a resource, with operations add, remove or replace.
  • PUT replaces a resource; the RFC says "PUT MUST NOT be used to create new resources".
  • DELETE removes a resource, though "Service providers MAY choose not to permanently delete the resource".

A team change is one call. Here the identity provider removes a person from a group:

http
PATCH /scim/v2/Groups/e9e30dba
Content-Type: application/scim+json

{ "schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
  "Operations": [ { "op": "remove", "path": "members[value eq \"2819c223\"]" } ] }

Two details matter for offboarding. A user's active attribute is defined as "A Boolean value indicating the user's administrative status", and RFC 7643 leaves its exact meaning to the service provider, so setting it to false may mean "suspended" in one app and "disabled" in another. And SCIM does not define how the client authenticates: the RFC says the protocol "does not itself define a SCIM-specific scheme for authentication and authorization". It says bearer tokens "MAY be used when combined with TLS and a token framework such as OAuth 2.0", and many apps issue the identity provider one long-lived token. Whoever holds that token can create accounts and change groups, so protect it like an admin credential.

The offboarding gap, step by step ​

Take a builder who leaves on Friday at 17:00.

  1. With SSO only. The identity provider disables the account at 17:00. The builder's laptop still holds a session cookie that lasts a week, and a CI job uses an API key they created. The session keeps working until it expires or someone ends it by hand. The key keeps working until someone finds it.
  2. With SSO and SCIM. At 17:00 the identity provider also sends a SCIM deactivation. The app ends the account's sessions and revokes its keys at once, if it is built to. The CI job breaks on Friday evening rather than leaking quietly for months, which is why automation should run under a service accountService account: An account for a program rather than a person, such as a CI job, with its own keys and its own limited permissions. and not a person's key.

SCIM only delivers the message. What the app does with active: false decides whether the gap closes. Ask any vendor or project: does deactivation end sessions? Revoke API keys? Remove project memberships? Hand over scheduled work?

When to use which ​

  • SSO alone suits a small team, short sessions and a habit of removing leavers by hand. Keep session lifetimes short so that a disabled directory account locks the person out soon.
  • SSO plus SCIM suits anything with many users, frequent team changes, admin roles managed in the directory, or audits that ask how quickly leavers lose access.
  • SCIM alone is rare. Some apps receive accounts by SCIM and sign people in with a password or another method, but most pair it with SSO.

How they combine ​

Run both against the same identity provider, and match them on stable keys. An OIDC account is identified by issuer and sub; a SAML account by the issuer and NameID. SCIM has its own pair: the id the app assigns, and an optional externalId that RFC 7643 defines as "an identifier for the resource as defined by the provisioning client". Decide which field links a SCIM user to an SSO identity before you turn either on, or you will end up with two accounts per person.

Decide which side owns roles. If groups arrive both in tokens at sign-in and through SCIM, they should say the same thing. A common split: SCIM creates accounts and keeps group membership current; SSO only signs people in. Role mapping from groups then happens in one place, and role-based access controlRBAC: Role-based access control: permissions are given to roles, such as admin or viewer, and people get roles, rather than permissions one by one. follows the directory. For the wider picture of who may build, run and approve, see identity for AI platforms. For how the two SSO protocols differ, see SAML vs OIDC.

In L2M ​

L2M, a self-hosted workflow builder and agent runtime, supports OIDC, SAML 2.0 and LDAP sign-in, and SCIM 2.0 provisioning, all optional. With SCIM provisioning turned on (SCIM_ENABLED=true; off by default), your identity provider manages accounts and groups at /scim/v2 with a bearer token an admin creates in the studio:

  • Deactivation closes the gap. active: false disables the account: no new password or SSO sign-in, all of its sessions end (break-glass sessions excepted) and all of its API keys are revoked in the same step, and MCP gateway clients it created drop to viewer. Workflows it owns keep their schedules and webhooks, so hand them over or turn them off. DELETE on the user also takes back the roles its groups gave and keeps the account and its history.
  • New accounts start low. A SCIM-created account gets the viewer role and an unusable password, so the person signs in through SSO. An existing account with the same email is linked rather than duplicated (by default not an admin's; SCIM_LINK_EXISTING_USERS decides).
  • Roles follow groups. A group grants roles only through a mapping with the provider SCIM groups. Mappings raise roles; when the person leaves the group, the role they had before comes back, unless an admin has changed it by hand since. SCIM never disables or demotes the last enabled admin.

With or without SCIM, accounts can also come from OIDC, SAML or LDAP sign-ins, invites or an admin, and these apply:

  • Accounts on first sign-in. An OIDC or SAML sign-in that matches no account creates one, with role viewer unless a group mapping says otherwise (OIDC single sign-on).
  • Allow-lists on every sign-in. OIDC_ALLOWED_GROUPS and OIDC_ALLOWED_EMAIL_DOMAINS (and the SAML equivalents) are checked on every login, for new and returning users, so removing someone from the allowed group at the identity provider refuses their next sign-in.
  • Group mappings. A mapping without a project sets the global role on each login but never lowers it; one with a project adds or updates a project membership (group-to-role mappings). Without SCIM, lowering a global role or removing a project membership is a manual change.
  • Ending access now. An admin can sign a user out everywhere from Settings → Access control → Users; that ends sessions only, and the user's API keys keep working. Deleting the user (DELETE /api/users/:id) removes the account with its sessions, API keys, SSO identities and project roles in one transaction.
  • Shorter windows. SESSION_IDLE_TIMEOUT_MINUTES and SESSION_ABSOLUTE_TIMEOUT_HOURS limit how long a session lasts after its last use, and in total (session policy).
  • Passwords next to SSO. Accounts that SSO creates get a random password. L2M has no SSO-only switch, so an account that was given its own password, for example through an invite, can still use it until it is deleted or SCIM disables it.
  • Automation off people. Service accounts cannot sign in and are not tied to an employee, so deleting a leaver does not break a pipeline that uses a service account key.

So without SCIM, an L2M offboarding is: disable the person at the identity provider, then delete the account in L2M and revoke any MCP gateway clients they created (a client whose creator is deleted keeps working as viewer). Signing it out everywhere is not enough on its own: it ends sessions, but the account's API keys keep working until you delete the account or revoke them. The audit log records the sign-out (session.revoked) and the deletion (user.delete). With SCIM on, the identity provider's deactivation does the sign-out and the key revocation for you, and is audited as scim.user.deactivate with the number of sessions ended and keys revoked.

Further reading ​

Last updated:

This website (not the L2M product) uses Google Analytics, only after you accept cookies. Cookie settings