Skip to content

SSO-only deployments: trusted domains sign in without linking, password sign-in can be turned off - #1237

Open
gedaiu wants to merge 6 commits into
deeplethe:devfrom
gedaiu:feat/oidc-auto-provision
Open

gedaiu wants to merge 6 commits into
deeplethe:devfrom
gedaiu:feat/oidc-auto-provision

Conversation

@gedaiu

@gedaiu gedaiu commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Closes #1236

Two opt-in settings for deployments where the identity provider already decides who may sign in. Neither changes anything for a deployment that doesn't set them.

UTOPIA_OIDC_ALLOWED_DOMAINS (comma-separated). When a login's subject isn't linked, and the ID token's email is email_verified and in one of these domains, Utopia links the active account with that email (case-insensitive). If there is none, it opens one through the same path as registration: default workspace, viewer, or the bootstrap admin on an empty deployment. The new account's password hash is !, which never verifies. The subject is then linked, so later logins go by subject as before. The callback and /auth/oidc/exchange share this mapping (account_of), so the exchange behaves the same. An unverified email, another domain, or an empty list gives today's unlinked.

UTOPIA_PASSWORD_LOGIN=false. /auth/login and /auth/register answer 422 password_login_disabled, /auth/oidc/status reports password_login, and the login page shows only the SSO button. If SSO isn't configured, the page keeps the form (loginSections), so the setting can't lock everyone out. Setting it back to true is the way in if the provider is down.

Both are documented in .env.example.

Tests: provisioned_email (verified, domain, look-alike domain, empty list), store tests for finding by email and opening a viewer account without a usable password, the exchange test extended with link-by-email, open-then-link-by-subject and unverified-refused, a route test for the password switch, and loginSections.test.ts. The full core, store and server suites pass against Postgres, along with clippy -D warnings, the web build and vitest.

🤖 Generated with Claude Code

gedaiu added a commit to re-cinq/lore that referenced this pull request Oct 15, 2026
…#2764)

Sets the two settings from deeplethe/utopia#1237 on our Utopia:

- `UTOPIA_OIDC_ALLOWED_DOMAINS=re-cinq.com`: a re-cinq.com Google login
with a verified email links the Utopia account that has that email, or
opens one (default workspace, viewer). Nobody has to set a password and
link Google by hand any more, and people without an account get one.
- `UTOPIA_PASSWORD_LOGIN=false`: the login page shows only "Sign in with
Google", and password sign-in and registration are refused. If Google
ever breaks, setting this back to `"true"` brings the password form
back.

It needs the image built from dev + #1234 + #1237
(`ghcr.io/re-cinq/utopia:0.1.0-dev-sso`), pinned in `terraform.tfvars`.
Until then, the image running now ignores both settings.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant