docs(gateway): correct what OIDC does with an existing account (CHOO-2726) - #440
Merged
Merged
Conversation
…2726) The page said an OIDC login is refused when a local account already owns the address, and that auto-linking by email does not happen. Both were true when the page was written and neither is true now: a verified address links to the existing account and signs in as it, and only an unverified one is refused. The correction matters twice over. It is the account-takeover guard, so a reader who believes the old text will misjudge what turning off the verified-email requirement costs. And it is the answer to a question the page implicitly denies: how an administrator signs in through the identity provider at all.
wojtyniakAQ
requested review from
amaudruz and
christian-mcdermott
as code owners
September 11, 2026 19:24
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
docs/old/GATEWAY_OIDC_SETUP.mdstates that an OIDC login is refused when a local account already owns the same email, and that auto-linking by email does not happen. That was true when the page was written. It is not true onmain:UserStore.get_or_create_oidc_userrefuses only when the token's email is unverified. A verified address is linked to the existing account, and the person signs in as that account — keeping its role, its rooms and its password login.Two reasons this is worth correcting rather than leaving to drift:
email_verifiedclaim, which meansGATEWAY_OIDC_REQUIRE_EMAIL_VERIFIED=falseremoves the only thing between a claimed address and the account that owns it. A reader working from the old text will misprice that setting.GATEWAY_ADMIN_EMAIL, so pointing that at an address the operator controls at the IdP makes SSO sign-in land in the admin account. Relevant to CHOO-2726.The page already warns the reader to check the code if it has drifted. It had.
Test plan
mainat 362bd6a: the unverified-only refusal and the linking branch incore/switch_core/db/stores/user_store.py, the seeded administrator's email and role incore/switch_core/main.py, and theemail_verifiedgate incore/switch_core/gateway/oidc_routes.py.