Skip to content

[codex] Support protected resource OAuth discovery#29022

Merged
xl-openai merged 1 commit into
mainfrom
codex/mcp-oauth-protected-resource
Jun 19, 2026
Merged

[codex] Support protected resource OAuth discovery#29022
xl-openai merged 1 commit into
mainfrom
codex/mcp-oauth-protected-resource

Conversation

@xl-openai

@xl-openai xl-openai commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Why

Plugin-install preflight and the actual OAuth login flow used different discovery implementations. Preflight had a Codex-specific implementation that only queried authorization-server metadata on the MCP host, while login already used the upstream rmcp Rust MCP SDK. As a result, servers that advertise a separate authorization server through RFC 9728 Protected Resource Metadata were classified as OAuth-unsupported during plugin installation, so login was skipped.

What changed

  • delegate plugin-install OAuth discovery to rmcp::transport::AuthorizationManager, the same implementation used by the login flow
  • let rmcp follow Protected Resource Metadata first and perform direct RFC 8414 authorization-server discovery when protected-resource discovery does not yield usable metadata
  • retain Codex's existing HTTP headers, timeout, no_proxy behavior, and scope normalization around that discovery
  • add unit coverage and a pure-MCP plugin-install integration test that proves the protected-resource path reaches OAuth client registration

This only changes shared MCP OAuth discovery. App declarations and appsNeedingAuth behavior are unchanged.

Verification

  • just test -p codex-rmcp-client auth_status
  • just test -p codex-app-server plugin_install_starts_mcp_oauth
  • real plugin-install smoke test with an isolated CODEX_HOME: both DigitalOcean MCP servers started OAuth callback listeners, while Linear continued to start its existing direct-discovery OAuth flow

@xl-openai
xl-openai marked this pull request as ready for review June 19, 2026 01:38
@xl-openai
xl-openai requested a review from xli-oai June 19, 2026 02:14
@xl-openai
xl-openai merged commit 4e6bc42 into main Jun 19, 2026
31 checks passed
@xl-openai
xl-openai deleted the codex/mcp-oauth-protected-resource branch June 19, 2026 04:17
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants