Passkin

Directory sync (SCIM 2.0)

Status: built (2026-10-05). Tests: apps/auth-broker/tests/scim.test.ts (15, with a client that sends what Okta and Entra ID send).

SSO answers "may this person sign in?". Directory sync answers "who works here, and in which groups?" — so that adding a person to the company directory gives them access to the product, and removing or deactivating them takes it away at once, without anyone touching the product. It is the other half of what WorkOS calls Directory Sync.

What it does

An organization's IT admin points their identity provider's provisioning (Okta, Entra ID, OneLogin, JumpCloud, Google Workspace…) at the directory's SCIM base URL with its bearer token. Passkin then:

  • Creates a person as a member of the organization — a record of the project with no passport (they claim theirs by signing in, like an imported user), in the role their groups map to.
  • Updates names, status, groups; an address that changes moves the membership with it.
  • Deactivates / deletes: removes the membership, ends every session that was acting in that organization (their refresh tokens stop working; back-channel logout is sent), and keeps the person's record in the product — it is the product's data, not the directory's to destroy.
  • Groups → roles: group_role_map: { "Admins": "org:admin" }. A member gets the most powerful role any of their groups maps to (by permission count), else the directory's default_role. Roles follow groups as they change.

The rules

  • A token opens one directory and nothing else. Stored as a hash, shown once at creation or rotation, revocable (rotate, pause, delete). A request for another directory, with a rotated, paused or unknown token, is 401.
  • Only an address on a domain the organization has verified may be provisioned (SSO.md): a directory cannot create ceo@gmail.com, or a person of another organization's domain. A directory needs a verified domain before it can be made.
  • With a directory, SSO lets in exactly who the directory names: a person it has not pushed, or has deactivated, is refused at SSO with "your organization has not given you access" — even if their identity provider would vouch for them. Membership comes from the directory (the connection's JIT switch applies only when there is none).
  • Every provisioning change is written to the project's activity log (via: scim) and sent as a webhook (directory.user.provisioned, .deprovisioned, .updated, directory.group.*).

Setting it up

By the developer (Backend API / dashboard Management API):

curl -X POST https://auth.passk.in/v1/organizations/$ORG/directories \
  -H "Authorization: Bearer $PASSKIN_SECRET_KEY" -H "Content-Type: application/json" \
  -d '{"name": "Okta", "default_role": "org:member", "group_role_map": {"Admins": "org:admin"}}'
# → { "id": "dir_…", "scim_url": "https://auth.passk.in/scim/v2/dir_…", "bearer_token": "scim_…" }   (the token: once)

GET|PATCH|DELETE …/directories/:did, POST …/directories/:did/rotate-token, GET …/directories/:did/users|groups (read-only views). Or by the customer's IT admin through the Admin Portal (intent: "dsync", SSO.md): add a directory, copy the URL and token (shown once, in the response itself — never in a cookie or a redirect), map groups to roles, pause, rotate or delete.

In Okta: Provisioning → Integration → SCIM connector base URL, unique identifier userName, authentication "HTTP Header". In Entra ID: Provisioning → Tenant URL and Secret Token. Supported push: create, update, deactivate (and delete) users; create, rename, change members of, delete groups.

Protocol

/scim/v2/<directory id>/ with ServiceProviderConfig, ResourceTypes, Schemas, Users, Groups — create (POST), read, list with ?filter=attr eq "value" (userName, externalId, emails.value, displayName, id), startIndex/count, replace (PUT), PATCH, DELETE. Responses are application/scim+json; errors follow RFC 7644 (scimType uniqueness, invalidValue, invalidFilter, invalidPath…). PATCH reads what the big providers actually send: operation names in any case (Replace/replace), active as "True"/"False", paths with filters (emails[type eq "work"].value, members[value eq "…"]), and path-less operations whose value is an object (Okta). Not supported (and said so): bulk, sort, ETags, password change.

Not built yet

SCIM for other resource types (devices, custom schemas), bulk, a "sync now / reconcile" action that compares the directory with the organization's members, attribute-to-metadata mapping, de-provisioning that bans the user project-wide when they have no other organization.

Ready to try it?

Create a project — the dashboard fills these snippets in with your own keys.

Open the dashboard