codex icon indicating copy to clipboard operation
codex copied to clipboard

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

Open felixzhang-glitch opened this issue 1 year ago • 15 comments

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

felixzhang-glitch avatar Aug 27 '25 06:08 felixzhang-glitch

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

Hrecha avatar Aug 28 '25 08:08 Hrecha

i met this problems too. Have you fixed it?

pandac55 avatar Sep 02 '25 07:09 pandac55

same problem, awaiting solution

johnmiroki avatar Sep 07 '25 02:09 johnmiroki

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

zkwabm avatar Sep 08 '25 06:09 zkwabm

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”

cxz4444 avatar Sep 09 '25 07:09 cxz4444

Same problem

vkamelin avatar Sep 18 '25 07:09 vkamelin

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

felixzhang-glitch avatar Sep 20 '25 03:09 felixzhang-glitch

The same

suyingke2004 avatar Sep 21 '25 06:09 suyingke2004

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

LucasLan666666 avatar Oct 24 '25 06:10 LucasLan666666

I have the same issue on ubuntu20.04 vscode

zx1119485151 avatar Oct 26 '25 03:10 zx1119485151

I have the same issue on ubuntu20.04 vscode

Me the same, do anyone know how to fix?

UnCrownGod avatar Oct 29 '25 23:10 UnCrownGod

I have the same issue on ubuntu20.04 vscode 我在 Ubuntu 20.04 vscode 上也遇到了同样的问题

Me the same, do anyone know how to fix? 我也是,有人知道怎么修复吗?

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

zx1119485151 avatar Dec 05 '25 06:12 zx1119485151

i have the same problem

LewisTs-ai avatar Jan 20 '26 11:01 LewisTs-ai

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

UnCrownGod avatar Jan 21 '26 01:01 UnCrownGod

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

hsv000 avatar Feb 12 '26 12:02 hsv000