[Linux][Ubuntu 22.04][VS Code][Codex] Token exchange failed: 403 when system proxy enabled

Resolved 💬 2 comments Opened Feb 17, 2026 by TH1RT3EN-LI Closed Feb 17, 2026

What version of the IDE extension are you using?

0.4.74

What subscription do you have?

Plus

Which IDE are you using?

VS Code

What platform is your computer?

Linux 6.8.0-100-generic x86_64 x86_64

What issue are you seeing?

On Ubuntu 22.04, VS Code Codex extension OAuth login fails at token exchange.
Error: "Token exchange failed: token endpoint returned status 403 Forbidden"
This happens when system proxy is enabled (HTTP/HTTPS/SOCKS 127.0.0.1:{port}), even with ignore hosts set to localhost/127.0.0.1/::1.

What steps can reproduce the bug?

  1. Ubuntu Settings -> Network -> Network Proxy -> Manual:

HTTP Proxy 127.0.0.1:{port}
HTTPS Proxy 127.0.0.1:{port}
Socks Host 127.0.0.1:{port}
Ignore Hosts: localhost,127.0.0.1,::1

  1. Launch VS Code and start Codex sign-in flow.
  2. Complete browser login.
  3. Observe extension error: token exchange 403 Forbidden.

What is the expected behavior?

Codex extension should complete OAuth login successfully, or correctly honor system proxy "Ignore Hosts" / VS Code http.noProxy so that local callback and token exchange behave as expected.

Additional information

Fix / Workaround:
In VS Code -> Settings (JSON), add:
{
"http.proxy": "http://127.0.0.1:{port}",
"http.noProxy": ["127.0.0.1", "localhost", "::1"],
"http.proxySupport": "override"
}

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗