Represent MCP authentication with an enum - #29924
Merged
Merged
Conversation
Contributor
Author
|
This change is part of the following stack: Change managed by git-spice. |
aibrahim-oai
force-pushed
the
codex/model-mcp-auth-strategy
branch
from
June 25, 2026 02:25
b0f2ef8 to
c667582
Compare
aibrahim-oai
marked this pull request as ready for review
June 25, 2026 02:51
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Why
MCP authentication has distinct OAuth and ChatGPT-session flows. Representing that choice as
use_chatgpt_authmakes one flow implicit and allows the configuration model to express the distinction only through a boolean.ChatGPT credential forwarding also needs a first-party trust boundary. A configurable
chatgpt_base_urlcontrols routing, but must not grant an MCP server permission to receive session credentials.This change builds on #29733, where the boolean was introduced.
What changed
use_chatgpt_authwith anauthfield backed by the exhaustiveMcpServerAuthenum.auth = "oauth"andauth = "chatgpt", with OAuth remaining the default.CHATGPT_CODEX_BASE_URLwhen granting ChatGPT auth to an MCP server.Verification
Integration coverage exercises the complete streamable HTTP startup path in two independent configurations:
chatgpt_base_urldoes not grant ChatGPT auth.config.tomlcontaining an attacker-controlledchatgpt_base_urlandauth = "chatgpt"verifies the same boundary through normal config parsing.Both tests complete MCP initialization and tool listing and assert that the full captured request sequence contains no authorization headers. Separate integration coverage verifies that configured authorization takes precedence over ChatGPT auth.