Skip to content

Fix MCP OAuth renewal and transport challenges - #436

Merged
asselstine merged 2 commits into
mainfrom
codex/mcp-oauth-renewal
Nov 24, 2026
Merged

asselstine merged 2 commits into
mainfrom
codex/mcp-oauth-renewal

Conversation

@asselstine

Copy link
Copy Markdown
Collaborator

What changes

  • Return canonical MCP HTTP bearer challenges: 401 invalid_token for inactive or revoked OAuth authorization, and 403 insufficient_scope with operation scopes when the credential is otherwise valid. Discovery and unrelated business/upstream errors keep their existing behavior.
  • Apply Factorize's live membership, session-version, and grant checks in the OAuth provider's refresh callback. Keep revocation locks through token rotation. Reject stale or revoked authorization with invalid_grant; preserve the original authorization ceiling and never reauthorize automatically.
  • Record only allowlisted authorization/refresh rejection reasons, without credentials, identities, URLs, or request bodies.

Validation

252 API tests, including the real OAuth provider with disposable PostgreSQL and local fixtures, and all 18 static checks passed. The new conformance test covers a standard credential expiring, HTTP 401, refresh without consent, an authorized MCP call, and renewal of the same grant's webhook subscription. It also covers a downscoped 403, an ordinary non-auth tool error, and rejection of inactive/revoked grants. CI still runs the dedicated Worker runtime tests. No live probing, automation changes, merge or deployment.

Reference: MCP Authorization, 2026-07-28.

@asselstine
asselstine merged commit b2e2203 into main Nov 24, 2026
9 checks passed
@asselstine
asselstine deleted the codex/mcp-oauth-renewal branch November 24, 2026 22:17
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.

1 participant