Codex Desktop OAuth login failure - CLI works but Desktop fails
What version of the Codex App are you using (From “About Codex” dialog)?
26.519.11010.0
What subscription do you have?
ChatGPT Pro
What platform is your computer?
Windows 10 Pro Version 2009 Build 10.0.26100.1 64-bit
What issue are you seeing?
Codex Desktop cannot complete authentication.
Error:
token_exchange_failed
Token exchange failed:
error sending request for url:
https://auth.openai.com/oauth/token
Codex Desktop version:
26.519.11010.0
Codex CLI version:
0.135.0
Important:
Codex CLI works correctly on the same machine, same account, same network, and same operating system.
Only Codex Desktop fails during OAuth token exchange.
Diagnostic steps already performed:
- Chrome and Edge both reproduce the issue.
- auth.openai.com is reachable.
- Invoke-WebRequest https://auth.openai.com/oauth/token returns the expected API response:
"Invalid method for URL (GET /oauth/token)"
- localhost:1455 OAuth callback is functioning.
- No WinHTTP proxy is configured.
- System date and time are correct.
- Kaspersky antivirus disabled.
- HTTPS inspection disabled.
- Codex Desktop cache cleared.
- WebView2 processes restarted.
- Codex Desktop reinstalled.
Expected behavior:
Codex Desktop should authenticate successfully.
Actual behavior:
Authentication fails with token_exchange_failed during OAuth token exchange.
What steps can reproduce the bug?
- Open Codex Desktop 26.519.11010.0.
- Click "Continue with ChatGPT".
- Browser opens and authentication completes successfully.
- Codex Desktop returns:
token_exchange_failed
- Login never completes.
Frequency:
100% reproducible.
What is the expected behavior?
Codex Desktop should successfully authenticate using the "Continue with ChatGPT" workflow.
After completing authentication in the browser, Codex Desktop should receive the OAuth token, complete the token exchange, sign the user in, and open the application normally.
The same account already authenticates successfully using Codex CLI 0.135.0 on the same machine, network, and operating system.
Additional information
Additional diagnostic information:
- Codex Desktop version: 26.519.11010.0
- Codex CLI version: 0.135.0
- Subscription: ChatGPT Pro
- Windows 10 Pro x64 (Build 10.0.26100.1)
Results of troubleshooting:
- Codex CLI authenticates and works correctly.
- Browser authentication works correctly.
- Chrome and Microsoft Edge both reproduce the issue.
- localhost:1455 OAuth callback is functioning.
- auth.openai.com is reachable.
- Invoke-WebRequest https://auth.openai.com/oauth/token returns the expected response:
"Invalid method for URL (GET /oauth/token)"
- No WinHTTP proxy configured.
- System date and time verified.
- Kaspersky antivirus disabled during testing.
- HTTPS inspection disabled.
- Codex Desktop cache cleared.
- WebView2 processes restarted.
- Codex Desktop reinstalled.
The issue appears isolated to Codex Desktop OAuth token exchange. The same account works successfully with Codex CLI on the same machine.
<img width="234" height="161" alt="Image" src="https://github.com/user-attachments/assets/52ad244d-defd-4e42-b16d-86a3e60e0281" />
4 Comments
Additional diagnostic information from
codex doctor:Environment:
Results:
Invoke-WebRequest https://auth.openai.com/oauth/tokenreaches the endpoint and returns the expected:"Invalid method for URL (GET /oauth/token)"
Desktop App still fails with:
token_exchange_failed
Token exchange failed:
error sending request for url:
https://auth.openai.com/oauth/token
Additional troubleshooting already performed:
The same account, machine, network, and operating system work correctly with Codex CLI 0.135.0.
This appears isolated to Codex Desktop OAuth authentication.
Update: The issue appears to be resolved after updating Codex Desktop.
Previous version:
26.519.11010.0
Current version:
26.527.3378.0
After updating to 26.527.3378.0, authentication completed successfully and Codex Desktop is now working normally.
Why I originally suspected a Codex bug:
codex doctordid not identify any critical connectivity failures.Because the same environment worked correctly with Codex CLI but consistently failed with Codex Desktop 26.519.11010.0, the evidence pointed toward a Desktop-specific issue rather than a local network or operating system problem.
The problem disappeared immediately after upgrading to Codex Desktop 26.527.3378.0, suggesting the issue was likely caused by a bug or regression in the previous Desktop build.
Thank you for the assistance.
I have encountered the same issue.
However, my current version is 26.601.21317, and I still have not been able to resolve it.
Resolved in my case. The root cause was a stale per-user proxy environment variable, not the Codex app itself.
My browser worked normally because it used the Windows system proxy, but Codex inherited old environment variables:
Port
6850was no longer listening. My actual proxy client was listening on127.0.0.1:7892. Because Codex was trying to use the dead port, it failed with:Before the login failure, I also saw repeated streaming errors:
What fixed it
7892with your own real port:To remove stale user variables instead:
ChatGPT.exeandcodex.exeprocess, then start the app again. Environment-variable changes only apply to newly started processes.After correcting the port and restarting all Codex/ChatGPT processes, both OAuth login and streaming worked immediately.
This is worth checking especially when browser login works but the Windows desktop app fails, and reinstalling the app does not help, because user environment variables survive an app reinstall.