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_
15 Comments
The same problem
Token exchange failed: token endpoint returned status 403 Forbidden
i met this problems too. Have you fixed it?
same problem, awaiting solution
Same problem for codex cli and extension in vscode. Can we have a solution?
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”
Same problem
Update the codex and delete the content in ~/.codex, then log back in; it seems this can resolve the issue.
The same
The same. I tried on windows and wsl but both failed.
I have the same issue on ubuntu20.04 vscode
Me the same, do anyone know how to fix?
可以试试卸载重新安装插件试试
i have the same problem
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:
{export NO_PROXY=127.0.0.1,localhost,::1}
{
export http_proxy=http://127.0.0.1:10809
export https_proxy=http://127.0.0.1:10809
}
{
"http.proxy": "http://127.0.0.1:10809",
"http.noProxy": "127.0.0.1,localhost,::1",
"http.proxySupport": "override"
}
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
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)
Then restart vscode and try