Directory, SCIM and offboarding

The directory keeps people and groups in the lake on top of the users listed in ontology.yaml. Your identity provider pushes people and groups to it over SCIM 2.0, rules turn the provider's groups and claims into ontology groups, access labels and attributes, and memberships given in the platform can end on a date. When someone leaves, deactivating them refuses their next request, revokes the tokens they already hold and hands the work they own to a named service owner, so nothing they set up stops or keeps running in their name

SCIM 2.0Users and groups pushed by your identity provider, such as Entra ID or Okta
Mapping rulesGroups and claims to groups, access labels and attributes
OffboardingRefused from the next request, with tokens revoked
Expiring accessMemberships with an end date and a reminder

In the platform today

Built
  • The directory runs in the platform service with tests
  • It holds a record per person, membership, identity provider group, group member and saved rule set, and it is read on every request, so a change takes effect on the next one
  • SCIM 2.0 is served at /scim/v2 for Users and Groups (create, get, list with eq filters and paging, replace, patch, delete), with ServiceProviderConfig and ResourceTypes, signed in with a service client token that has permissions: [scim] or a static token
  • Settings are under directory: in ontology.yaml; administrators manage people, memberships and rules at /api/v2/directory, and every change is audited as directory.*
  • A background job turns off inactive accounts and ends memberships
On request
  • ETags, bulk operations, sorting and /Schemas in SCIM, and SAML 2.0 sign-on
Requirements
  • Sign-on with OpenID Connect, as on the access model, for sign-in times, token cut-offs and the groups in each token
  • An enterprise application in your identity provider with SCIM provisioning, pointed at https://<tenant>/scim/v2
  • A service client with permissions: [scim], or a static token in the environment variable directory.scim.tokenEnv names
  • Administrator to manage people, memberships and rules

How a person is built

ontology.yaml stays the base. The person a request runs as is built from these sources, in order

  1. The YAML user. The entry under users:, if there is one
  2. The directory entry. Its name, title and email replace the YAML ones, its attributes replace YAML attributes of the same name, and its access labels are added. A directory person with no YAML user is a new user
  3. Groups. The YAML groups, plus memberships given here that have not ended, plus identity provider groups, from SCIM and from the last sign-in token, mapped through auth.groupMap and the mapping rules
  4. Attributes from rules. Added to list attributes, such as stations. For one name, the directory entry wins over rules, and rules over the YAML
  5. Status. A directory entry that is inactive or removed turns off a YAML user too

Groups and access labels are only ever added to the YAML ones. To take one away, edit ontology.yaml or end the membership. Deactivated people stay in the registry so the definitions that name them, such as an automation's owner or a dashboard's, stay valid, and requests that run as them are refused

Configure the directory

auth:
  groupMap:                          # identity provider group to ontology groups, at sign-in
    MX-Controllers: maintenance-control
  serviceClients:
    # this client's tokens may call /scim/v2
    entra-sync: { user: svc.entra, name: Entra sync, permissions: [scim] }
directory:
  # runs the automations, alert rules, connectors and folders of someone deactivated
  serviceOwner: svc.automation
  inactiveAfterDays: 90              # turn off accounts with no sign-in for this long
  inactivityWarningDays: 7           # inbox warning this many days before
  inactivityExempt: [svc.reports, group:break-glass]
  # longest membership given here; one given without an end gets this length
  membershipMaxDays: 180
  membershipReminderDays: 7          # inbox reminder before a membership ends
  # a static token, for identity providers that send one
  scim: { tokenEnv: SCIM_TOKEN, user: svc.scim }
  rules:
    - match: { group: "MX-Control*" }   # a glob, case-insensitive
      groups: [maintenance-control]
    # a regular expression; captures fill {station}
    - match: { group: "re:^Station-(?P<station>[A-Z]{3})$" }
      groups: ["station-{station}"]
      attributes: { stations: ["{station}"] }
    # a token claim, else a directory attribute
    - match: { claim: department, value: Quality }
      accessLabels: [SAFETY]
KeyDefaultMeaning
serviceOwnerNoneThe user that runs the automations, alert rules, connectors and folders of someone deactivated, unless a service owner is given when deactivating
inactiveAfterDaysOffDeactivate people whose last sign-in is this many days old
inactivityWarningDays7Warn them in the inbox this many days before
inactivityExemptNonePeople and group: ids the timer never deactivates. Service clients are always exempt
membershipMaxDaysNoneThe longest membership an administrator can give; one given without an end gets this length
membershipReminderDays7Inbox reminder to the person and whoever gave the membership, before it ends
scim{ tokenEnv: SCIM_TOKEN }The environment variable holding a static SCIM token, and the user it runs as
rulesNoneGroup-mapping rules, described below

SCIM provisioning

Point your identity provider's provisioning at /scim/v2. It signs in with a bearer token: with sign-on, an access token for a service client whose auth.serviceClients entry has permissions: [scim], or the static token in the variable directory.scim.tokenEnv names, for providers that send a fixed secret

SCIM attributeBecomes
userNameThe person's user id
displayName, or nameName
titleTitle
Primary emailattributes.email, which notifications use
activefalse deactivates, true reactivates
Enterprise department, employeeNumber, manager.valueAttributes of the same name, which rules and row policies can read
Extension urn:marklandstreet:params:scim:schemas:extension:ontology:2.0:User accessLabelsAccess labels added to the person
Groups and their membersIdentity provider groups, mapped through auth.groupMap and the rules

A SCIM DELETE on a user is a deactivation that also hides the person from SCIM. Nothing is deleted from the lake

PATCH /scim/v2/Users/fl.tremblay
{
  "schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
  "Operations": [{ "op": "replace", "path": "active", "value": false }]
}

Group-mapping rules

A rule matches an identity provider group by a glob, case-insensitive, on the group's name or its last / part, or by a regular expression written re: whose named captures fill placeholders. It can also match a claim of the last sign-in token, or else a directory attribute, with a value. Every rule that matches applies, giving groups, access labels and attributes. Rules in ontology.yaml come first, then the ones saved with PUT /api/v2/directory/rules

Before anyone signs in, check what they would get. The preview names where each group and access label comes from

POST /api/v2/directory:preview
// Request
{ "user": "fl.tremblay", "groups": ["Station-YHZ", "MX-Controllers"] }

// Response, shortened
{
  "user": "fl.tremblay", "status": "active", "refused": null,
  "groups": [
    { "group": "maintenance-control", "from": ["rule directory.rules[0]"],
      "expiresAt": null },
    { "group": "station-YHZ", "from": ["rule directory.rules[1]"], "expiresAt": null }
  ],
  "rulesMatched": ["directory.rules[0]", "directory.rules[1]"]
}

Memberships that end

An administrator can give a person a group for a time, with POST /api/v2/directory/people/{id}/groups and {"group", "expiresAt"} or {"group", "days"}. The membership stops counting at its end on the platform clock, and the timer records it as expired. The person and whoever gave it get an inbox reminder membershipReminderDays before. People can also be pre-registered with POST /api/v2/directory/people before their first sign-in. For access to one label or group asked for from a refused screen, see access requests

Offboarding

An administrator, SCIM active: false or DELETE, or the inactivity timer deactivates a person. From that moment

  • Their next request is refused with 401 USER_DEACTIVATED
  • A cut-off is recorded. With sign-on, tokens issued before it stay refused with 401 TOKEN_REVOKED even after the person is reactivated, so a reactivated person signs in again
  • Their proposals waiting for a decision stay for others to decide. Where an agent or automation proposed one with them as the approver, administrators get an inbox notice
  • Automations, alert rules, connectors and folders they own keep running under the service owner given when deactivating, or directory.serviceOwner. What they owned and who runs it now is recorded on their entry as handover. With no service owner, that work stops with USER_DEACTIVATED until someone takes it over
  • Webhook subscriptions that run as them are skipped, as for any unknown person

Reactivating restores access from the next sign-in, and the work goes back to the person

POST /api/v2/directory/people/fl.tremblay:deactivate
{ "reason": "Left the company on 2026-10-27", "serviceOwner": "svc.automation" }

Inactive accounts

With inactiveAfterDays, the timer deactivates people whose last sign-in is that old, or, for someone who never signed in, whose directory entry was made or last reactivated that long ago, after an inbox warning inactivityWarningDays before. Sign-ins are recorded with sign-on only, once per session. People listed only in ontology.yaml who have never signed in are not deactivated for inactivity; manage them in the file. The check runs every five minutes by default, a service setting

API

EndpointDoes
GET /api/v2/directory/people, /people/{id}Everyone, with status, last sign-in, groups and where each comes from
POST /api/v2/directory/peoplePre-register {id, name, title, email, groups, accessLabels, attributes}
PATCH /api/v2/directory/people/{id}Change name, title, email, access labels or attributes
POST …/people/{id}:deactivate, :reactivateWith a reason, and for deactivation an optional service owner
POST …/people/{id}/groups, DELETE …/groups/{group}Give a membership, with expiresAt or days and a note, or end it
POST /api/v2/directory:previewWhat a person would get at their next sign-in, from {user | email, groups, claims}
GET and PUT /api/v2/directory/rulesThe rules with where each comes from and any problems, and replacing the rules saved through the API
/scim/v2/Users, /Groups, /ServiceProviderConfig, /ResourceTypesSCIM 2.0 for identity providers

Every change is in the audit log, for example directory.user.deactivated, directory.membership.expired, directory.rules.changed and directory.scim.user_patched

Limitations

  • SCIM filters take eq only. ETags, bulk operations, sorting and /Schemas are delivered on request
  • SAML 2.0 sign-on is delivered on request; sign-on today is OpenID Connect
  • The directory only adds groups and access labels to ontology.yaml. A group or label given in the file is taken away by editing the file
  • Sign-in times, and so inactivity, are recorded with sign-on only
  • With several copies of the service, the others see a directory change after a short refresh interval, a service setting; the copy that made it sees it on its next request

Related