Skip to content

docs(gateway): correct what OIDC does with an existing account (CHOO-2726) - #440

Merged
petr-sandbox merged 1 commit into
mainfrom
docs/oidc-linking-correction
Sep 14, 2026
Merged

petr-sandbox merged 1 commit into
mainfrom
docs/oidc-linking-correction

Conversation

@wojtyniakAQ

Copy link
Copy Markdown
Collaborator

Summary

docs/old/GATEWAY_OIDC_SETUP.md states 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 on main:

  • UserStore.get_or_create_oidc_user refuses 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:

  • It is the account-takeover guard. The page presents the refusal as the protection. The actual protection is the email_verified claim, which means GATEWAY_OIDC_REQUIRE_EMAIL_VERIFIED=false removes the only thing between a claimed address and the account that owns it. A reader working from the old text will misprice that setting.
  • It denies something the product supports. "How does an administrator sign in through the identity provider?" currently has no answer on this page, because the page says linking cannot happen. It can: the seeded administrator is an ordinary account on 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

  • Documentation only; no code touched.
  • Verified against main at 362bd6a: the unverified-only refusal and the linking branch in core/switch_core/db/stores/user_store.py, the seeded administrator's email and role in core/switch_core/main.py, and the email_verified gate in core/switch_core/gateway/oidc_routes.py.
  • No credentials, internal hostnames or personal data.

…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.

@petr-sandbox petr-sandbox left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice.

@petr-sandbox
petr-sandbox merged commit b3eecaf into main Sep 14, 2026
10 checks passed
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