mirror of
https://github.com/openai/codex.git
synced 2026-10-22 17:58:46 +00:00
## Why A persisted login replacement can leave the auth cache holding the previous login, even for the same account. Enterprise MCP authorization must detect that replacement before continuing to use enterprise credentials. ## What changed - Check cached and persisted account login ownership before enterprise MCP connections and around token exchanges, revoking authorization when ownership changes. - Recheck account ownership and login generation before committing enterprise sign-in credentials. - Compare complete token data when checking whether an account OAuth grant is still current, and expose grant token access and credential comparison helpers. ## Testing Add regression coverage for detecting a same-account login replacement without updating cached auth, rejecting enterprise MCP use after replacement, and keeping ordinary MCP usable while an enterprise account storage read is blocked. GitOrigin-RevId: 6303f88a9cbcc84c99e453dc281b23d66930f518