Repository navigation
Description
An organization that runs fctl for its people wants them to sign in the way they sign in everywhere else:
- with Okta, Microsoft Entra ID, Google Workspace, JumpCloud, OneLogin, Keycloak or another identity provider;
- under the provider's policies (MFA, device checks, offboarding);
- with no separate fctl password to forget, phish or leave behind when someone leaves.
fctl signs people in only with a password (with a second factor or passkeys) or with Google, and no setting turns passwords off. Organizations that standardized on Google can't require Google either: an account with a password can still use it. docs/organizations.md says so plainly: "fctl doesn't sign people in through SAML or another OpenID Connect provider".
How it works now
- Google sign-in (
crates/fctl-control/src/api/google.rs) is OpenID Connect with PKCE against Google's fixed endpoints, configured withGOOGLE_CLIENT_IDandGOOGLE_CLIENT_SECRET(Config::google).- It links the identity in D1's
identities(provider = 'google',subject). - It trusts an address only where Google hosts it: Gmail, or a Workspace account's
hd(fctl_domain::google::vouches_for).
- It links the identity in D1's
- Passwords (argon2id), passkeys and two-factor sign-in (ADR 0022, 0023):
InstanceSettings.require_two_factorandtwo_factor_google, and a workspace's own requirement (workspaces.require_two_factor). That requirement closes the workspace to people who don't meet it (fctl_domain::two_factor::workspace_blocked,fctl_domain::workspace::Membership.blocked). - Who may sign up is an allowlist of addresses and
*@domainpatterns (crates/fctl-domain/src/allowlist.rs), plus invitations. - Provisioning. Admin tokens create accounts without a password (ADR 0085,
crates/fctl-control/src/api/provision.rs). The docs say their people then sign in with Google, but a Google sign-in refuses any address whose account has no Google identity linked (google_link_required), so in practice they need a reset link first (Accounts that admin tokens create can't sign in with Google, though the docs say they can #613). - Sign-ins. A browser's sign-in is a
tokensrow of kindweb; CLI sign-ins (cli) come from the device flow, approved in a browser. Neither records how its person signed in.
What should happen
- Sign-in providers. Instance admins add OpenID Connect providers under Admin → Sign-in, or with
fctl admin sign-in add:- Okta, Entra ID, Google Workspace, JumpCloud, OneLogin, Keycloak, authentik, or any issuer with a discovery document;
- with a name and icon for the button, the client id and secret, the scopes, and the claim that carries groups.
- Providers live in D1, the secret sealed with the master key, so adding one needs no restart.
FCTL_OIDC_*environment variables configure one too, for infrastructure as code.- Google becomes one such provider, with what it has today kept as it is.
- Identities keyed the way each provider is stable.
- Keyed by
(issuer, sub)inidentities; for Entra,tidandoid. - Never by address: Microsoft says Entra's
emailclaim "isn't guaranteed to be correct and is mutable… Never use it for authorization", and a single-tenant app, which a self-hosted instance's would be, can still receive unverified addresses. - A provider's address makes or matches an account only for domains the admin says the provider is authoritative for ("Okta vouches for acme.com and acme.dev"), generalizing
vouches_for. - OneLogin and authentik (2025.10 and later) don't send
email_verifiedunless set up to, and the setup says so. - Existing accounts. A provider's first sign-in links to an existing account at its address only when the provider is authoritative for that domain, and either the account has no sign-in method yet (made by an admin token or SCIM), or the provider is required for the domain, which moves everyone off passwords.
- Elsewhere, people link a provider from Settings, as they link Google today: linking silently would let one account take over another.
- Keyed by
- A test sign-in first. Saving a provider asks the admin to sign in with it once. fctl shows what it sent (subject, name, address, groups) before anyone else can use it.
- Requiring a provider.
InstanceSettings.sign_insays, per domain, how people at it sign in: "acme.com and acme.dev: Okta only".- Passwords and other providers then stop working for those addresses. Passkeys keep working only if the admin allows them (they are quick, but skip the provider's checks).
- People at other domains (contractors) sign in as before, with the instance's two-factor requirement.
- The sign-in page asks for the address first and sends people at such domains straight to their provider.
- A way in when the provider is down. The primary instance owner always keeps their password and passkeys, and the page that requires a provider says so. Optionally, a few named break-glass accounts.
- A workspace's own requirement: "Acme requires signing in with Okta", beside its two-factor requirement. (for Google: feat(control): let a workspace require Google sign-in of its members #659)
- Each sign-in records how it was made: a new
tokens.auth_method, with CLI sign-ins taking the method of the browser sign-in that approved them. workspace_blockedcloses the workspace to sign-ins made another way, until its person signs in again with the provider.
- Each sign-in records how it was made: a new
- Accounts only from the directory (
InstanceSettings.self_sign_up, off): nobody creates an account by signing in or with a domain entry, only admin tokens, SCIM (Provision people with SCIM, and give roles from the identity provider's groups #619) and invitations. The sign-in page tells a stranger who to ask. - Fields the directory manages are read-only. A provisioned or provider-managed account's name, addresses and picture show "Managed by Okta" in Settings, and change only through the provider, an admin token or SCIM.
- Session policies (Admin → Sign-in): (feat(control): limit how long sign-ins last, and where they come from #657)
- how long a browser stays signed in, and how long it may sit unused;
- how long a CLI sign-in lasts;
- the longest an access token may last, and whether members may make them at all;
- optionally, the addresses (IP ranges) the app and API take sign-ins and requests from, with runners' connections and fctl's webhooks exempt.
- Signing out from the provider. Okta's Universal Logout and OpenID back-channel logout, where a provider offers them, revoke the person's fctl sign-ins at once. Elsewhere, disabling the account through an admin token or SCIM does it, as it does today.
- SAML through a bridge, documented. Larger organizations ask for SAML, and Google sends groups only to SAML apps. Verifying XML signatures in a WebAssembly Worker is hard to do safely: the Rust crates need OpenSSL and xmlsec, or are young and unaudited, and SAML libraries keep turning up signature bypasses (ruby-saml, March 2025). So document SAML through Keycloak or authentik as an OIDC bridge, and keep native SAML for later.
- app.fctl.sh only: domain verification. A workspace proves a domain with a DNS TXT record before it may require a provider for that domain or send its people to its provider. Without it, one customer could claim another's domain. Self-hosted instances don't need it: their admins own the allowlist.
- CLI and docs.
fctl admin sign-in(list, add, test, require, policies) with--json.- docs/self-hosting.md (a section per provider, with screenshots of each provider's own setup), docs/organizations.md, docs/security.md, docs/api.md, docs/cli.md and docs/llms.txt.
- fctl-site's privacy policy, if app.fctl.sh takes providers.
Design and UX
Setting up single sign-on is usually a nervous afternoon. In fctl it should take five calm minutes, with no way to lock yourself out and a clear picture of who is affected before anything changes.
-
Admin → Sign-in reads like the instance's front door. A sentence of how people sign in today ("Everyone signs in with a password or Google; 38 people use a password"), then the providers, then the policies.
-
Adding a provider is a guided sheet:
- Pick the provider from logos.
- Copy fctl's redirect URL, with a one-click copy.
- Paste the issuer, client id and secret. Each field says where to find it in that provider's console, with a link.
- Test it: sign in in a popup, then see "Okta says you are Ada Lovelace, ada@acme.com, in groups eng, eng-web".
- Choose the domains it covers.
Mistakes show in words: "Okta answered that the redirect URL isn't allowed: add https://fctl.acme.dev/api/v1/auth/oidc/callback to the app's sign-in redirect URIs".
-
Requiring it shows its consequences first. "38 people at acme.com sign in with a password today: their next sign-in goes through Okta, and their passwords stop working. 4 people at other domains keep theirs. You keep your password as the way in if Okta is down." Then one button.
- The people affected get an email, where the instance sends email.
- Next time they come back, a banner on the sign-in page explains the change.
-
The sign-in page leads with the provider's button in its own colors and logo ("Continue with Okta"). Typing an address at a covered domain turns the form into that button.
-
In Settings, a managed account shows "Your name and address come from Okta" where the fields were. The sign-in methods section explains why there's no password.
-
The CLI prints the same consequences before
fctl admin sign-in require, and asks to confirm unless--yes. -
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. Hosts and agents are untouched.
- Data.
- New D1 tables for providers and domain rules, and a new
tokens.auth_methodcolumn. Sign-ins from before it count as "unknown" and meet no provider requirement, so a workspace that turns one on asks everyone to sign in again once. InstanceSettingsgains fields that clients which don't send them keep (fctl_domain::settings::keep_unsent). Older CLIs can't change them.
- New D1 tables for providers and domain rules, and a new
- Google sign-in keeps working as it does through the move to providers: same callback URL, same identities.
Decisions for a person
- Where providers can be set: self-hosted instances only at first, or app.fctl.sh too (which brings domain verification and per-workspace providers).
- Passkeys under a required provider: allowed by default or not.
- Break-glass: whether named break-glass accounts exist beyond the primary instance owner.
- SAML: a documented bridge only, or native SAML on the roadmap.
Session: https://app.fctl.sh/s/ses_01M8450BECFP8DN88R0ZP0N0MS
Activity
fctl-sh commentedon Nov 23, 2026
Progress: #642 (open) does the part for Google on self-hosted instances, as Carl Oscar asked: "Relevant mostly for Google sign-in currently but make it flexible if we want to support other providers in the future. This is mostly relevant for self-hosted instances of fctl."
In it:
InstanceSettings.sign_in, Admin → Sign-in,fctl admin sign-in require acme.com acme.dev). Covered accounts sign in with Google alone as an address there: passwords, personal Google accounts and passkeys alone (unless the rule allows them) stop working. The sign-in page says which domains sign in with Google and turns its form into Google's button for an address there.tokens.auth_method,auth_domain). CLI sign-ins take it from the browser that approved them, and access and admin tokens from the sign-in that made them. Every request checks it, and saving a rule deletes the covered people's sign-ins it doesn't meet, those from before it included.fctl admin unlink).InstanceSettings.self_sign_upoff).api::sign_in, which another OpenID Connect provider can use.Left for later pull requests:
FCTL_OIDC_*(Okta, Entra ID keyed bytid/oid, JumpCloud, OneLogin, Keycloak, authentik), with the guided setup sheet, their test sign-in and the domains each vouches for.Decisions taken there, listed under its "Worth confirming": rules are instance-wide; passkeys alone are off by default; only the primary instance owner is exempt; a covered person's password goes at their first Google sign-in; requiring Google ends the other sign-ins of covered people at once.
fix(control): close the gaps the review found in sign-in rules
fix(control): let admins unlink a recreated Google account
fix(web): name whose Google account the unlink dialog takes
fctl-sh commentedon Nov 24, 2026
hyperstructure/fctl-site#141 merged (51fc64e) and is live at fctl.sh/privacy: it says each browser session, CLI sign-in and access token keeps how its sign-in was made, and which Google details each sign-in refreshes. app.fctl.sh starts keeping that once #642 merges and deploys; until then the policy describes a little more than it keeps.
fctl-sh commentedon Nov 24, 2026
hyperstructure/design#78 merged (4926abf):
docs/web-app/explaining.mdnow documents Admin → Sign-in, the sign-in page's provider-led form and what Settings says to someone a rule covers. It is docs only, so the web app needs no new design tag. The section says it was written from #642 ahead of its merge; that note can go once #642 merges.fctl-sh commentedon Nov 24, 2026
#642 merged (2eb0658) and is deployed to app.fctl.sh (CI's deploy, 2026-11-24 07:27 UTC). Its CLI commands (
fctl admin sign-in,fctl admin unlink,fctl admin set --self-sign-up) ship with the release after v0.37.1. hyperstructure/design#81 merged too: the design docs now name the decision's record, ADR 0099.I ticked three items #642 does and verified, with tests and a run against
cargo xtask serve(see its description):InstanceSettings.sign_in(Admin → Sign-in,fctl admin sign-in require).self_sign_upoff. Allowed exact addresses still sign up, as an admin named them, while domain entries don't.#647 follows up on three findings from #642's last review round, which merged unanswered:
The rest of this issue (other OIDC providers, session policies, a workspace's own requirement, provider sign-out, the SAML bridge docs, managed fields, domain verification for app.fctl.sh) is still to do.
fctl-sh commentedon Nov 24, 2026
#647 merged (c545d87) and is deployed to app.fctl.sh (CI's deploy, 2026-11-24 08:31 UTC), with its docs pinned on fctl.sh. An admin's unlink now signs the person out everywhere, and a second-factor code that a rule refuses no longer counts as a wrong attempt. Its CLI wording ships with the release after v0.37.1, with #642's commands. The leftovers listed above are unchanged.
fctl-sh commentedon Nov 26, 2026
Carl Oscar scoped what's left of this issue to Google sign-in, with other providers moved to new issues. Here's where each open item stands:
fctl admin sign-in policiesand Admin → Sign-in → Staying signed in and Networks. All its checks pass.fctl workspaces set --require-google acme.com). It closes only that workspace, so it needs no domain verification (ADR 0103).tid/oid), and directory-managed names: Sign in with Okta, Microsoft Entra ID and other OpenID Connect providers #650.fctl admin sign-in(show, require, unrequire, policies) and the docs ship with feat(control): limit how long sign-ins last, and where they come from #657 and feat(control): let a workspace require Google sign-in of its members #659.addandtestcome with providers, in Sign in with Okta, Microsoft Entra ID and other OpenID Connect providers #650.Once #657 and #659 merge, this issue can close, with its leftovers in #650–#653.
fctl-sh commentedon Nov 28, 2026
#657 merged (ed926ea) and is deployed to app.fctl.sh (CI's deploy, 2026-11-28 10:07 UTC), with its docs pinned on fctl.sh. Its CLI command,
fctl admin sign-in policies, ships with the release after v0.38.1. Admins can now set how long browsers and CLIs stay signed in, the longest an access token lasts, whether members make access tokens, and the networks sign-ins come from (ADR 0102).The design docs for it, and for #659's pages, are in hyperstructure/design#84. What's left of this issue for Google is #659, a workspace's own requirement: it's up to date with main and all its checks pass. Its privacy policy line is hyperstructure/fctl-site#144, a draft to merge with it. Once #659 merges, this issue can close, with its leftovers in #650–#653.
fctl-sh commentedon Nov 29, 2026
#659 merged (81f4253) and is deployed to app.fctl.sh (CI's deploy, 2026-11-29 09:07 UTC), with its docs pinned on fctl.sh. A workspace's admins can now require Google of its members at their domains, in its Settings → Access or with
fctl workspaces set --require-google acme.com(ADR 0103).--require-googleships with the release after v0.38.1, with #657'sfctl admin sign-in policies. The companions are merged too: hyperstructure/design#84 (the design docs for both) and hyperstructure/fctl-site#144 (the privacy policy now says a workspace keeps those domains, live at fctl.sh/privacy).I ticked the two items those merges did: session policies (#657) and a workspace's own requirement, for Google (#659). This finishes the issue for Google, as Carl Oscar scoped it, so I'm closing it. What's left lives in new issues:
fctl admin sign-in addandtestcome with providers, in Sign in with Okta, Microsoft Entra ID and other OpenID Connect providers #650.