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_

View original on GitHub ↗

6 Comments

github-actions[bot] contributor · 9 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #5283
  • #5221
  • #6403
  • #5955

Powered by Codex Action

cpthgli · 9 months ago

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:

  • VS Code: 1.105.1
  • OS (Host): Windows 11
  • Node (Windows): v24.11.0
  • WSL: 2.6.1.0
  • OS (WSL): Ubuntu 22.04.5
  • Node (WSL): v22.21.0

I can share additional logs or reproduction details if helpful.

dylan-hurd-oai contributor · 9 months ago

@cpthgli @Fleating could you try running rm ~/.codex/auth.json in 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 investigate

craighooghiem · 9 months ago

I 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.

etraut-openai contributor · 9 months ago

Closing in favor of #4562

MaeseppTarvo · 5 months ago

rm ~/.codex/auth.json is only thing that is really the fastest solution to continue your work! Seems like Codex is new Swift/Xcode