Skip to content

Support enterprise MCP sign-in without refresh tokens - #62129

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/ee7e253627c8274f9b3096e3b87e92e2f99885ea
Nov 17, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/ee7e253627c8274f9b3096e3b87e92e2f99885ea

Conversation

@copyberry

@copyberry copyberry Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Support enterprise MCP sign-in without refresh tokens

Why

An enterprise identity provider can return an OpenID Connect ID token
without issuing a refresh token, even when Codex requests
offline_access. The refresh-token requirement blocked those sign-ins.

What changed

For ema_auth, keep requesting offline_access and prefer a refresh
token when available. Otherwise, use the stored ID token for the ID-JAG
exchange after checking its issuer, audience, and expiry. Require
reauthentication when the ID token is expired or invalid and no refresh
token is available.

Update rmcp to 3.6.0 for ID token exchange support.

Testing

Add regression coverage for sign-in with and without a refresh token,
ID token expiry and issuer binding, and the subject token type sent to
the identity provider.

## Why

An enterprise identity provider can return an OpenID Connect ID token
without issuing a refresh token, even when Codex requests
`offline_access`. The refresh-token requirement blocked those sign-ins.

## What changed

For `ema_auth`, keep requesting `offline_access` and prefer a refresh
token when available. Otherwise, use the stored ID token for the ID-JAG
exchange after checking its issuer, audience, and expiry. Require
reauthentication when the ID token is expired or invalid and no refresh
token is available.

Update `rmcp` to 3.6.0 for ID token exchange support.

## Testing

Add regression coverage for sign-in with and without a refresh token,
ID token expiry and issuer binding, and the subject token type sent to
the identity provider.

GitOrigin-RevId: ee7e253627c8274f9b3096e3b87e92e2f99885ea
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/ee7e253627c8274f9b3096e3b87e92e2f99885ea branch from fccfb0d to 7066a55 Compare November 17, 2026 23:33
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor
Codex Review Summary: 🔄 Running

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-11-17T23:33:33.451041Z fccfb0d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@copyberry
copyberry Bot merged commit 7066a55 into main Nov 17, 2026
11 of 24 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/ee7e253627c8274f9b3096e3b87e92e2f99885ea branch November 17, 2026 23:33
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 17, 2026

This branch was previously deployed

1 inactive deployment
issue-triage — 7066a55a Deployed Nov 17, 2026 by drewclifton via Generate label suggestions #64031
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