Repository navigation
feat(customer-identity): sign ZITADEL's administrator in with GitHub - #6355
Conversation
…nistrator The setup CronJob gains a recovery step that runs only when ADMIN_RECOVERY_NONCE holds a value no run has recorded yet. For the administrator alone it unlocks the account, removes every second factor and passkey, keeps the password and sends ZITADEL's own password-reset email. It records the value on the client Secret once the factors are gone, so later runs do nothing, even after a new factor is enrolled. The login policy still forces MFA, so the next sign-in enrols one. Nothing the reset creates is printed. This change sets the trigger once; a follow-up removes it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The administrator will sign in with GitHub instead of a password, so the recovery no longer sends ZITADEL's password-reset email. It now also removes recovery codes, and its final check reads the sign-in method types, which include them, so the nonce is recorded only when nothing but the password is left. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The maintainer's ZITADEL login collided with his mail login in Apple Passwords, so he signs in with GitHub through the platform Dex instead of a ZITADEL password and passkey. - The platform Dex's shared client accepts ZITADEL's Login V1 callback. - The setup CronJob keeps that Dex configured as a generic OIDC identity provider of his organization, which neither creates nor links accounts. It sets that organization's login policy to external sign-in only, with MFA forced for local sign-in alone, and links his account to his GitHub identity as Dex presents it. - Customers get a "Customers" organization, which keeps the instance's password and MFA policy. The customer Dex requests it, so they are not sent to GitHub and no one else signs in there. - ZITADEL may reach dex.platform.devantler.tech. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rface The platform Dex gains ZITADEL's callback and the customer Dex requests the Customers organization, so both HelmReleases render differently. Their ledger entries take the hashes the authorization contract reports. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The recovery compared the recorded nonce inside a test, where a failed Secret read is not an error under set -e: it read as "not recorded", and a later run removed whatever the administrator had enrolled since. The read is now its own assignment, so a failure stops the run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
✅
|
✅
|
Ready at
|
Storage-maintenance coordination: the host reboot completed, and its journal is now in the guarded The OpenBao setup wait is dependent on that scheduling recovery, which uses the same production lock. Please preserve this run's bounded outcome and avoid another deployment cycle until the queued recovery finishes. This requests no priority change or bypass. |
Storage-recovery handoff: the guarded resume completed successfully. Its journal is The storage-maintenance dependency that blocked the previous deployment is cleared. Please reassess this PR at its current head through the ordinary review, CI and production queue gates. This is a recovery handoff, not a merge or queue-priority override. The follow-up recovery-code defect is tracked internally in #6364; no upstream fix is required for this handoff. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

What
The maintainer signs in to ZITADEL (accounts.devantler.tech) with GitHub, through the platform Dex, instead of a ZITADEL password and passkey. Apple Passwords merges saved credentials that share a username across devantler.tech subdomains, and his ZITADEL login collided with his mail login. He chose GitHub sign-in for his admin account.
k8s/providers/hetzner/infrastructure/controllers/dex/patches/allow-zitadel-sign-in.yaml): the sharedpublic-clientaccepts ZITADEL's Login V1 callback,https://accounts.devantler.tech/ui/login/login/externalidp/callback. Dex already federates GitHub and admits only the devantler-techmaintainersteam. No new GitHub OAuth App is needed.infrastructure/oidc/dexthrough the newplatform-dex-clientExternalSecret, mounted as a file. A fingerprint annotation re-sends it only when it changes.forceMfaLocalOnly), and no password reset. GitHub's own two-step login covers MFA.CggyNjIwMzQyMBIGZ2l0aHVi, which is Dex's encoding of GitHub user 26203420 through connectorgithub. This is cross-checked against business-site'scustomeridentity.DexSubject.customers.accounts.devantler.tech), which keeps the instance's login policy: password and MFA.urn:zitadel:iam:org:domain:primary:customers.accounts.devantler.tech. Customers therefore sign in under the Customers organization's policy, and nobody outside it can sign in there. Without the scope, ZITADEL would use his organization's GitHub-only policy for them, because his is the default organization.dex.platform.devantler.tech:443.His ZITADEL password stays, but nothing can use it: his organization allows no local sign-in, and ZITADEL never shows a password prompt or reset link there. The broken authenticators are removed by #6353, whose commits this branch contains until it merges. Break-glass stays the reviewed, disarmed recovery step.
What he sees
He opens https://accounts.devantler.tech/ui/console. ZITADEL sends him to Dex, and Dex sends him to GitHub. If his browser already has a GitHub session, he comes straight back to the console. There is no ZITADEL password, passkey or MFA prompt.
Validation
Ran against a local ZITADEL v4.20.3 with the same configuration:
created the Customers organization, created the GitHub identity provider, set the administrator's organization to GitHub sign-in, linked the administrator to GitHub. The second run:no changes.allowUsernamePasswordoff,allowExternalIdpon,forceMfaandforceMfaLocalOnlyon, andhidePasswordReseton, with exactly the GitHub provider. The instance policy has no providers. His link carries the subject above. The Customers organization has primary domaincustomers.accounts.devantler.tech.https://dex.platform.devantler.tech/auth?client_id=public-client…&code_challenge_method=S256…&redirect_uri=https://accounts.devantler.tech/ui/login/login/externalidp/callback.prompt=select_account, which ZITADEL adds, and goes straight to its GitHub connector.Other checks:
ksail --config ksail.prod.yaml workload validate: 972 files validated.The prod
apps,infrastructure,infrastructure/controllersandclusters/prodbuilds pass, and the Dex HelmRelease renders with the new redirect URI.yamllintwith the repository config is clean; the one warning already exists on main.shellcheckon the embedded script and the pinned naming gate both pass.End to end (local): an upstream Dex v2.46.1 stood in for the platform Dex. Its password connector played GitHub, and the test link carried that connector's subject. A browser walk with no organization scope went ZITADEL → Dex →
/ui/login/login/externalidp/callback→/oauth/v2/authorize/callback→ the client's callback with an authorization code. ZITADEL asked for no password, MFA or email verification. (Locally this neededZITADEL_HTTPCLIENT_DENYLISTrelaxed, since the test Dex has a private address. In productiondex.platform.devantler.techresolves to Cloudflare's public addresses, and the cluster DNS has no rewrite. While the administrator still had a one-time password, ZITADEL asked him to change it after GitHub; in production he already set his own.)Fail-closed checks: a link to a different subject stops the run with
the administrator is linked to a different GitHub identity.Not proven offline: the real GitHub round trip, which needs this Dex change deployed.
Part of devantler-tech/business-site#302.
🤖 Generated with Claude Code