[Linux][Ubuntu 22.04][VS Code][Codex] Token exchange failed: 403 when system proxy enabled
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?
- 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
- Launch VS Code and start Codex sign-in flow.
- Complete browser login.
- 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"
}
2 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
If your proxy blocks the localhost access, you won't be able to use the normal oauth flow. Either configure your proxy to allow access to the required ports or refer to this documentation for alternative auth mechanisms.