feat: OpenAI Codex ChatGPT OAuth + v2.1.1#203
Merged
Conversation
- openai_codex_oauth(): reads ~/.codex/auth.json (auth_mode=chatgpt), decodes JWT exp claim for expiry detection - openai_codex_refresh(): single-use refresh token flow, always writes new token back to auth.json immediately - openai_codex_login(): full Auth Code + PKCE flow on port 1455, matching Codex CLI's redirect URI - _codex_jwt_expiry(): decode JWT exp without signature verification - main(): dispatch for --refresh / --login / read-existing - registry.py: correct base_url → chatgpt.com/backend-api/codex/responses, backend → oauth - config.yaml: fix token/refresh endpoints to auth.openai.com, correct client_id and base_url Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
~/.codex/auth.json, Auth Code + PKCE login (port 1455), single-use refresh token handling, JWTexpexpiry detectionchatgpt.com/backend-api/codex/responses(notapi.openai.com)config.yamlendpoints and client IDTest plan
faigate-auth openai-codexreads existing credentialsfaigate-auth openai-codex --refreshrotates single-use tokenfaigate-auth openai-codex --loginopens browser on port 1455🤖 Generated with Claude Code