Skip to content

Auto-create staff users from Google sign-in on staging - #142

Merged
yahyafakhroji merged 1 commit into
mainfrom
feat/idp-auto-create-allowlist
Sep 22, 2026
Merged

yahyafakhroji merged 1 commit into
mainfrom
feat/idp-auto-create-allowlist

Conversation

@yahyafakhroji

Copy link
Copy Markdown
Collaborator

Problem
On staging the staff portal is pinned to a Zitadel org that has registration switched off. A new staff member's first Google sign-in there ends on "sign-up is not available", so an admin creates the user in the Zitadel console by hand, which forces a password. When that person already has a Datum Cloud user for the same Google account the username collides as well, which is where the +staff aliases come from.

Solution
Three env flags, all unset by default and never set in production, open one door in the SSO callback: an IdP-verified email on an allow-listed domain may auto-create a user in a listed org even though registration is off. If the email already owns a user in another org, the user is created under the +staff alias instead, the same shape admins produced by hand. Password sign-up stays off and the sign-up link stays hidden. ADR 007 records the rationale and the removal steps for when staging moves to a single org.

Refs #140

Temporary interim for staging's dual-org setup (ADR 007). An IdP-verified
email on an allow-listed domain may auto-create a user in a listed org
whose login policy disallows registration, so new staff sign in with
Google instead of a hand-made password user. When that email already
owns a user in another org, the user is created under the +staff alias,
matching the convention admins applied by hand. Fully off unless both
IDP_AUTO_CREATE_EMAIL_DOMAINS and IDP_AUTO_CREATE_ORGS are set, which
production never does.

Refs #140
@github-actions

Copy link
Copy Markdown
Contributor

🧪 Test Summary

Job Status
E2E (fast, fake provider) ✅ success
Unit Tests (component) (0) ✅ success
Unit Tests (component) (1) ✅ success
Unit Tests (component) (2) ✅ success

View workflow run

@yahyafakhroji
yahyafakhroji merged commit 89e53e2 into main Sep 22, 2026
16 checks passed
@yahyafakhroji
yahyafakhroji deleted the feat/idp-auto-create-allowlist branch September 22, 2026 07:12
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.

2 participants