Sign-in error when using the remote env in vscode
Resolved 💬 20 comments Opened Aug 29, 2025 by wglassly Closed Sep 16, 2025
💡 Likely answer: A maintainer (gpeal, contributor)
responded on this thread — see the highlighted reply below.
What version of the VS Code extension are you using?
0.4.0
Which IDE are you using?
VS Code
What platform is your computer?
Darwin 24.5.0 arm64 arm
What steps can reproduce the bug?
when I use the codex at remote env, click sign-in
<img width="422" height="1222" alt="Image" src="https://github.com/user-attachments/assets/511bc5c3-4f3a-48f9-a0bc-f3002835f1da" />
the browser returns: Token exchange failed: token endpoint returned status 403 Forbidden
<img width="566" height="78" alt="Image" src="https://github.com/user-attachments/assets/fd1add4e-d77e-43c6-af6a-85e64e868456" />
What is the expected behavior?
_No response_
What do you see instead?
_No response_
Additional information
_No response_
20 Comments
I hit the same issue in Codespaces.
/wham/environmentscalls return403 ForbiddenWorkaround:
Forcing the extension to run on the UI/local side instead of the remote host fixes it. Example setting in remote
settings.json:After this, CodeX works normally in Codespaces.
~~Works for me, thx a lot.~~
Seems that the extension running in the host can NOT identify the files in the remote server
This doesn't fit my situation. As shown below, codex can see the file.
It seems that this is not a universal solution, there may be other bugs.
<img width="404" height="415" alt="Image" src="https://github.com/user-attachments/assets/9c9885d0-2fa0-45f6-a581-4fb728ca36fa" />
I also have to workaround this to login to Codex CLI via GitHub Codespaces (e.g. https://github.com/asw101/codespaces ).
This is the workflow I have to follow: https://youtu.be/jVxj-JQOe2Y
I can do this as a power user, but it is very hard for me to recommend this experience to anyone.
The most general solution for now is to use ssh port forwarding. Just use ssh to bind the
localhost:1455on the local machine to thelocalhost:1455on the remote machine. And then open the link shown on the remote terminal on the local machine. Login and wait for the callback. This is twisted but it works! Ask your _local_ codex if it sounds a bit complex :)已解决,需要使用代理启动code
Is there a more detailed solution?
:~$ HTTPS_PROXY=http://:*** HTTP_PROXY=http://:***
NO_PROXY=localhost,127.0.0.1,::1 code
ubuntu 终端 打开code
frondesce @.***> 于2025年9月16日周二 10:57写道:
Xian Shi @.***> 于2025年9月16日周二 15:57写道:
This is the same as #2796 which we're working on resolving but for now, you can log in like this
Here's how I fixed it:
这个方法最好
"remote.extensionKind": {
"openai.chatgpt": "ui"
}
重启窗口
完成!
No, this doesn't mean the extention can actually see the files in your remote server. It can only see the path of you file which you are currently looking at. It cannot read the file itself. Via this method, the extension is actually working on you local machine, so it can only access the files in your local computer. When you ask codex to explain the code on the remote server to you, it says that it can't access the file. And what the extension actually sees is the file in your local computer! Check the photo below.
<img width="1562" height="1184" alt="Image" src="https://github.com/user-attachments/assets/b725d46a-c303-44ca-959b-4a0e22789c47" />
不,这并不意味着扩展可以实际查看您远程服务器上的文件。它只能看到您当前查看的文件路径,无法读取文件本身。通过这种方式,codex实际上是以本地vscode ui 的方式在您的本地计算机上工作,因此它只能访问您本地计算机上的文件。当您要求Codex为您解释远程服务器上的代码时,它会说无法访问该文件。而扩展实际上看到的是您本地计算机上的文件!请查看下面的照片。
<img width="1562" height="1184" alt="Image" src="https://github.com/user-attachments/assets/5ac20ba6-13bc-49c4-b056-601b66d6b99e" />
I already tried this, It got flagged as malicious...lol
me too lol
Note. This method does not work now.