Unable to authenticate Codex extension in Visual Studio Code when WSL is enabled
Resolved 💬 6 comments Opened Nov 9, 2025 by Fleating Closed Nov 14, 2025
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
What version of Codex is running?
0.4.38
What subscription do you have?
ChatGPT Plus
Which model were you using?
n/a
What platform is your computer?
Windows 11
What issue are you seeing?
In Visual Studio Code, when enabling "Run Codex In Windows Subsystem For Linux" (WSL) I cannot sign into my ChatGPT account (using Google account) to authenticate. It gives the error: Token exchange failed: error sending request for url (https://auth.openai.com/oauth/token)
What steps can reproduce the bug?
- Turn on "Run Codex In Windows Subsystem For Linux" in extension settings
- Try to sign in
- Use Google account as sign in
- FAIL
What is the expected behavior?
Expect to sign in and authenticate as it does when WSL is not enabled.
Additional information
_No response_
6 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
I’m seeing the same behavior in my VS Code extension environment.
It starts occurring from v0.4.37 and does not reproduce on v0.4.35 (downgrading to 0.4.35 works around the problem).
Environment:
I can share additional logs or reproduction details if helpful.
@cpthgli @Fleating could you try running
rm ~/.codex/auth.jsonin WSL? And then restarting VS Code. We've seen a number of reports about this on different platforms. Would help to isolate the root cause as we investigateI am having this issue ever since I hit "yes" on "Reboot VS Code into WSL Mode".
There is no auth.json file in WSL and I deleted that file in my native Windows 11 setup.
I cannot get the localhost callback to hit VS Code at all, whether I am in WSL or not.
Closing in favor of #4562
rm ~/.codex/auth.json is only thing that is really the fastest solution to continue your work! Seems like Codex is new Swift/Xcode