Repository navigation
Open
Labels
cliThe fctl CLIcontrol-planeThe Worker, Durable Objects and D1enhancementNew feature or requestsecurityAccess gaps, CVEs, sign-in and tokenswebThe web app
Description
An organization's identity provider already knows who works there, which teams they're on and when they leave. Okta, Entra ID, JumpCloud and OneLogin push that to apps over SCIM 2.0. fctl doesn't speak SCIM, so an organization has two choices today:
- writes a sync job against fctl's own people endpoints with an admin token;
- or uses its provider's workflow tools to call them.
Either way, it maps teams to workspaces and projects by hand. People who join a team don't get its projects until someone runs the sync, and the roles in fctl drift from the groups in the directory.
How it works now
- Admin tokens (
fctl_adm_…, self-hosted only,FCTL_ADMIN_TOKENS=1; ADR 0085) reach the admin API's people endpoints alone (fctl_domain::admin_tokens::allows):- creating, reading, changing, disabling and deleting accounts;
- putting people in workspaces and projects with a role;
- setting their Claude token;
- making reset links.
- Code:
crates/fctl-control/src/api/provision.rsandapi/admin.rs; docs/api.md#people-with-an-admin-token; docs/organizations.md#people-from-your-directory.
- Disabling an account signs its person out everywhere, revokes their tokens and stops the sessions that run on their subscription (
auth::revoke_tokens). - Deleting it removes the workspaces only they are in.
- Re-running a sync is safe: adding someone to a workspace or project they're in already gives them the role it names, and creating an account for an address that has one answers
409. - No groups. There is no notion of a group: roles are per person, per workspace and per project.
- Sign-in through providers' groups depends on Sign in with the organization's own identity provider, and require it #618.
What has to be designed for (IdPs as of 2026-11)
- Okta
- Custom (non-catalog) apps send every user update,
active: falseincluded, as PUT, and group memberships as PUT with the whole member list. Catalog apps use PATCH. - It filters on
userName eq "…", pages withstartIndexandcount, expects409for a duplicate, and never deletes users.
- Custom (non-catalog) apps send every user update,
- Entra ID
- Sends PATCH.
opis capitalised (Add,Replace,Remove), andactiveis the string"False"unless the app opts into Microsoft's 2020 behavior (aadOptscim062020). - Filters on
userNameandexternalId, and on groupdisplayNamewithexcludedAttributes=members. - Deprovisions with
active=false, then deletes 30 days later. Syncs about every 40 minutes. Still allows a long-lived bearer token for non-gallery apps. - Its default mapping sends neither
oidnorsub. To link a provisioned account to sign-ins, admins map objectId toexternalId.
- Sends PATCH.
- JumpCloud, OneLogin, Rippling and authentik push SCIM 2.0 too. OneLogin and JumpCloud attach it to a SAML app.
- Google Workspace pushes to custom apps only in a limited beta: for SAML apps, users only, no groups. Google shops get accounts at first sign-in instead (Sign in with the organization's own identity provider, and require it #618).
- Claims at sign-in versus SCIM groups. Groups read from a sign-in's claims only change when someone signs in again, so roles from them go stale. Groups pushed over SCIM stay current. Entra sends group object ids, not names, and caps the groups claim at 200 (past that it sends a pointer to Graph).
What should happen
- A SCIM 2.0 endpoint at
/scim/v2:Users(list with filters, read, create, replace, patch, delete),Groups(the same),ServiceProviderConfig,ResourceTypesandSchemas.- It's built on the code admin tokens use, so the rules hold: limits on workspaces, the primary instance owner untouchable, a workspace's primary admin kept.
- It takes Okta's PUTs and Entra's PATCH dialect, both tested against recorded requests from each.
- A SCIM token (
fctl_scim_…) made under Admin → Provisioning, shown once, that reaches only/scim/v2. It acts as the admin who made it, as admin tokens do: it stops when they stop being an admin, and the audit log names it on every entry. - Users.
userNameis the primary address;name.givenNameandfamilyName,emails,externalIdandactivemap onto the account.active: falsedisables the account, with everything disabling does today;active: trueenables it again.- DELETE deletes it, or disables it where the admin chose "never delete".
- Groups to roles. A group pushed over SCIM, or named in a sign-in's groups claim, maps to roles through rules that admins write: "eng-web → member of Acme, editor of web", "eng-leads → admin of Acme".
- Rules can also give the workspace's base role, or a project's.
- A person's role is the highest that any rule or direct grant gives.
- Leaving a group removes what only that group gave.
- Accounts at first sign-in (just in time): with a provider that covers a domain (Sign in with the organization's own identity provider, and require it #618), a person who signs in without an account gets one, and their groups' roles from the claim. SCIM then keeps them current where the provider pushes it.
- What fctl shows.
- Each person's workspaces and projects say which rule or group gave the role ("editor of web through eng-web").
- A role given by a group can't be removed by hand without a warning that the next sync gives it back.
- CLI and docs.
fctl admin provisioning(tokens, rules, a dry run of what a group would give) with--json.- docs/organizations.md, a section per provider in docs/self-hosting.md (Okta, Entra ID, JumpCloud, OneLogin), docs/api.md, docs/cli.md and docs/llms.txt.
Design and UX
Hooking fctl up to the directory should be a short, guided setup with a dry run. Afterwards, anyone should be able to tell why a person has the access they have.
- Admin → Provisioning starts with the outcome: "Your directory decides who's in fctl, and on which teams". Then a lead built from this instance: "Today 52 people were added by hand and 12 by an admin token".
- Connecting a provider is three steps:
- Copy the SCIM URL and a new token.
- Paste them in the provider. Each provider has its own short guide with screenshots, and Entra's guide includes the
aadOptscim062020flag and the objectId →externalIdmapping. - Watch the first push arrive live: "Okta created 3 people and 2 groups, just now".
- Rules read as sentences, built with Selects: "People in [eng-web] are [editors] of [web]".
- Before saving, a preview names who it changes: "Gives Ada and Grace editor in web; takes it from Lin, who left eng-web".
- Groups show by name even where Entra sends ids, once SCIM has pushed them.
- A person's page shows where each role comes from ("through eng-web, from Okta", "added by Grace") and when the directory last changed them.
- The CLI's dry run prints the same changes as a table before anything applies.
- Follow hyperstructure/design's docs:
docs/principles.md;docs/web-app/explaining.mdfor pages that set something up (a headline that names the outcome, a lead built from this place's facts, a preview of the result, one primary action, and who can act);docs/web-app/kit.mdfor controls. - Design every state before building it: the first visit, loading, errors and refusals, waiting, partial setups and long lists.
- Say what happens, plainly, and never leave someone at a disabled control without saying who can act.
- Prototype the main screens with realistic data (
cargo xtask demo's world) and review them before building the rest. - Check both themes, a phone's width, the keyboard, screen readers and reduced motion, and show screenshots in each pull request.
- Give the CLI the same care: readable output,
--json, and errors that say what to do next. - Add or update the pages of hyperstructure/design's docs for each new component, with the reasons behind its choices.
Compatibility
- Control plane only.
- New D1 tables: SCIM tokens, groups, group members, and rules with the roles they give.
- Grants record where each role came from, so that removing a group removes only its roles.
- Existing roles stay as direct grants. A rule never takes away a role someone was given by hand.
- Deployments. Like admin tokens, SCIM is for self-hosted instances unless decided otherwise (
FCTL_ADMIN_TOKENSor a setting of its own).
Decisions for a person
- Where it runs: self-hosted instances only, or app.fctl.sh too (with domain verification from Sign in with the organization's own identity provider, and require it #618).
- Hand-given roles: whether rules may also take away roles people were given by hand, for organizations that want the directory to be the only source.
- Deletes: whether a SCIM DELETE deletes the account, or only disables it by default.
- Order: whether SCIM comes before or after sign-in providers (Sign in with the organization's own identity provider, and require it #618). They're independent, but most organizations want both.
Session: https://app.fctl.sh/s/ses_01M8450BECFP8DN88R0ZP0N0MS
Metadata
Metadata
Assignees
Labels
cliThe fctl CLIcontrol-planeThe Worker, Durable Objects and D1enhancementNew feature or requestsecurityAccess gaps, CVEs, sign-in and tokenswebThe web app
Activity