Skip to content

fix(oauth): restore long-lived ChatGPT MCP access - #102

Merged
teckedd-code2save merged 3 commits into
mainfrom
fix/chatgpt-oauth-refresh-20260920
Sep 20, 2026
Merged

teckedd-code2save merged 3 commits into
mainfrom
fix/chatgpt-oauth-refresh-20260920

Conversation

@teckedd-code2save

Copy link
Copy Markdown
Owner

Symptom

The ChatGPT Ground Control app worked immediately after OAuth, then later reported that it no longer had access.

GroundControl access tokens currently expire after one hour. The refresh-token endpoint required client_id on every refresh request, even for public PKCE clients using token_endpoint_auth_method=none.

OAuth 2.0 does not require an unauthenticated public client to repeat client_id in the refresh-token request. The refresh token is already bound to the GroundControl grant/client.

Fix

  • refresh_token remains required.
  • client_id becomes optional only when the registered client uses token_endpoint_auth_method=none.
  • If ChatGPT does send client_id, GroundControl still requires an exact match.
  • Any future client using authenticated token-endpoint methods must still identify/authenticate itself.

This preserves the client binding while accepting the public-client refresh shape.

Why existing connections can recover

The previous code rejected a refresh request before rotating or revoking the stored refresh token when client_id was absent. Existing ChatGPT refresh credentials should therefore remain valid after this patch, unless ChatGPT has already discarded the credential and requires a reconnect.

Validation

Adds regression coverage for:

  • public client refresh without repeated client_id
  • exact match when client_id is supplied
  • rejection for authenticated/confidential client methods that omit identity

@teckedd-code2save
teckedd-code2save merged commit 92a1ac5 into main Sep 20, 2026
3 checks passed
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