Finish signing in via your browser: token endpoint returned status 403 Forbidden

Resolved 💬 15 comments Opened Aug 27, 2025 by felixzhang-glitch Closed Sep 28, 2025

What version of Codex is running?

_No response_

Which model were you using?

_No response_

What platform is your computer?

_No response_

What steps can reproduce the bug?

I’m a Plus user, and I’ve failed to log into Codex five times already. > Finish signing in via your browser: token endpoint returned status 403 Forbidden. This is really a terrible experience — much worse than Claude Code.

What is the expected behavior?

_No response_

What do you see instead?

_No response_

Additional information

_No response_

View original on GitHub ↗

15 Comments

Hrecha · 10 months ago

The same problem
Token exchange failed: token endpoint returned status 403 Forbidden

pandac55 · 10 months ago

i met this problems too. Have you fixed it?

johnmiroki · 10 months ago

same problem, awaiting solution

zkwabm · 10 months ago

Same problem for codex cli and extension in vscode. Can we have a solution?

cxz4444 · 10 months ago

I have the same issue—every time I log in, I end up encountering this problem. I've tried switching browsers and numerous methods, but nothing has worked. Yet it functions perfectly on the web version. What a frustrating experience.
“Token exchange failed: token endpoint returned status 403 Forbidden”

vkamelin · 10 months ago

Same problem

felixzhang-glitch · 10 months ago

Update the codex and delete the content in ~/.codex, then log back in; it seems this can resolve the issue.

suyingke2004 · 10 months ago

The same

LucasLan666666 · 8 months ago

The same. I tried on windows and wsl but both failed.

zx1119485151 · 8 months ago

I have the same issue on ubuntu20.04 vscode

UnCrownGod · 8 months ago
I have the same issue on ubuntu20.04 vscode

Me the same, do anyone know how to fix?

zx1119485151 · 7 months ago
> I have the same issue on ubuntu20.04 vscode 我在 Ubuntu 20.04 vscode 上也遇到了同样的问题 Me the same, do anyone know how to fix? 我也是,有人知道怎么修复吗?

可以试试卸载重新安装插件试试

LewisTs-ai · 6 months ago

i have the same problem

UnCrownGod · 6 months ago

Hi Community, I have a solution for this bug

OS: Ubuntu 20.04
VS Code: APT / .deb version
Browser: Firefox
Network: Optional proxy via Clash Verge
Issue: VS Code Codex login fails
Token exchange failed: token endpoint returned status 403 Forbidden

FIX:

  1. Ensure localhost never goes through proxy

{export NO_PROXY=127.0.0.1,localhost,::1}

  1. If using proxy (Clash / V2Ray), use HTTP port (example 10809)

{
export http_proxy=http://127.0.0.1:10809
export https_proxy=http://127.0.0.1:10809
}

  1. VS Code settings.json

{
"http.proxy": "http://127.0.0.1:10809",
"http.noProxy": "127.0.0.1,localhost,::1",
"http.proxySupport": "override"
}

  1. Browser

Use system proxy
Under Settings -- Network Settings -- Use system proxy settings -- No proxy for
{localhost, 127.0.0.1}

You may noticed that after you re-open your pc, the vscode can not be opened properly, for everytime you wanna open your vscode, type
{code --disable-layout-restore --user-data-dir /tmp/vscode-fix &
}

I haven't fix this issue yet

hsv000 · 5 months ago

I signed in to codex.

I use Windows + WSL,
My nekoray (nekobox) running on Windows listens on 0.0.0.0:20800, and ip: 192.168.7.114

All you need to do is edit bashrc in WSL:

add to /etc/environment (if vscode run from root) or to ~./bash.rc (if from user)

export ALL_PROXY="socks5h://192.168.7.114:20800"
export http_proxy="$ALL_PROXY"
export https_proxy="$ALL_PROXY"
export NO_PROXY="127.0.0.1,localhost,::1"
export no_proxy="$NO_PROXY"

Then restart vscode and try