Repository navigation
Description
An organization that provisions its people with admin tokens, on an instance with Google sign-in, follows the docs: "A new account has no password: its person signs in with Google where the instance has it" (docs/organizations.md#people-from-your-directory). docs/self-hosting.md#provision-people-with-admin-tokens says the same. When the person presses Sign in with Google with that address, fctl refuses: "An account with this email exists. Sign in with your password, then link Google in Settings." They have no password, so they're stuck until an admin sends them a reset link. This is the main sign-in path for organizations on Google Workspace.
I found this by reading the code, while drafting the guides in #614. I haven't reproduced it, since cargo xtask dev has no Google stand-in.
How it works now
- The Google callback (
crates/fctl-control/src/api/google.rs,callback) signs in only an account whose Google identity is linked (identities,provider = 'google'). When none is linked and any account has the address (auth::user_by_email), it refuses withgoogle_link_required. The comment says why: "Linking by email silently would let a Google account take over a password account; the owner links it from Settings instead." - The message for that refusal is in
web/src/routes/auth.tsx: "An account with this email exists. Sign in with your password, then link Google in Settings." - Provisioning (
crates/fctl-control/src/api/provision.rs,create) makes the account with an allowlist entry of its own, and without a password, a passkey or a linked identity, unless the request sets apassword. - Linking Google from Settings takes a browser that signed in within the last 15 minutes (
fresh_sign_in). So the only way in for a provisioned person is a password set fromfctl admin reset-link(emailed where the instance sends email), then linking Google.
What should happen
One of these, which is a decision for a person:
-
Take the first Google sign-in. A Google sign-in links to an existing account when all of these hold:
- the account has no sign-in method at all: no password, no passkey, no linked identity;
- Google vouches for the address (
fctl_domain::google::vouches_for: Gmail, or a Workspace account'shd); - the account is active.
Nobody has signed in to such an account, so there is nothing to take over. The account was made for that address, and Google says the person holds it now. The audit log records
identity.linkedwithvia: first_sign_in, and fctl emails the address that Google was linked, as it does today. Accounts with any sign-in method keep today's rule. -
Or change the docs. docs/organizations.md and docs/self-hosting.md stop promising Google for new accounts. They say to send a reset link and link Google after the first sign-in, and the admin API's create call gains a way to send that link at once.
Either way:
- A test in
crate::testingcovers a provisioned account's first Google sign-in, and the sign-in page's message names what to do.
Design and UX
The first sign-in is someone's first impression of fctl, so it should simply work. Where it can't, it should say exactly what to do next.
- With the first option, nothing new shows. The person signs in with Google, lands on the Agent Floor, and gets the usual "A Google account was linked to your account" email.
- With the second option, the reset link's email and page greet the person as new ("Acme set up your fctl account: choose a password, then link Google in Settings if you like"), rather than as someone who forgot a password.
- The refusal's message stops telling people without a password to sign in with one. It says: "Your account has no password yet: ask an admin of this instance for a sign-in link".
- 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.
- Check both themes, a phone's width, the keyboard, screen readers and reduced motion, and show screenshots in each pull request.
Compatibility
- Control plane only. No migration: the change is in the callback's rule.
- Docs: docs/organizations.md, docs/self-hosting.md and docs/architecture.md#identity-and-access.
Decisions for a person
- Take a provisioned account's first Google sign-in (the first option), or document the reset link (the second).
- If the first: whether it also applies to accounts that admin tokens made with a password that nobody has used yet.
Session: https://app.fctl.sh/s/ses_01M8450BECFP8DN88R0ZP0N0MS
Activity
fix(control): hold a first Google sign-in to the address Google vouch…
fctl-sh commentedon Nov 23, 2026
#633 corrects the docs to match the code as it is today:
organizations.md,self-hosting.mdandcli.mdnow say a provisioned account signs in first with a reset link (which works for an hour), then links Google under Settings → Security. The new "Accounts only from your directory" section follows that. The decision here is still open. If provisioned accounts come to take a first Google sign-in, those passages change with it.fctl-sh commentedon Nov 23, 2026
Done in #632 (merged as ea83ebd), which took the first option. A Google sign-in now links Google to an account with no way in at all: no password, passkey or linked identity. The account must be active, and Google must vouch for the address. The audit log records
identity.linkedwithvia: first_sign_in. Accounts with a way in keep the old rule, and the sign-in page's refusal now names that way: password, passkey or another Google account. A test against the control plane's D1 stand-in covers a provisioned account's first Google sign-in. An account that an admin token made with apasswordkeeps the old rule, even if nobody has used the password yet (the issue's open decision; see #632's Worth confirming).Deployed to app.fctl.sh: main's CI run for ea83ebd passed and deployed it, and fctl.sh's docs are pinned to that commit. It's a control plane and web app change, so self-hosted instances get it with the next release. #633's docs still describe the old rule. I commented there with what to change.