cannot complete authentication with "sign in with chatgpt" option

Resolved 💬 9 comments Opened Oct 25, 2025 by AlmarionAI Closed Oct 25, 2025
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of the VS Code extension are you using?

Version: 1.105.1 (Universal)

What subscription do you have?

pro

Which IDE are you using?

VS Code

What platform is your computer?

mac os

What issue are you seeing?

I use Codex inside VsCode, it is working normally but when I wanna install it on a VsCode remote session, it asks me to reauthenticate. I follow the standart authenticate process as I select "sign in with chatgpt" option, it directs me to a link where I enter my username and password and then after successfully logged in, it opens a consent screen to click on Continue

and then it opens this page first when I click on continue

https://auth.openai.com/oauth/authorize?response_type=code&client_id=app_EMoamEEZ73f0CkXaXp7hrann&redirect_uri=http://localhost:1455/auth/callback&scope=openid profile email offline_access&code_challenge=hW0J5LNS_OLtJzD-a25mQC8So-G7jwLgNcrv8NtteSE&code_challenge_method=S256&id_token_add_organizations=true&codex_cli_simplified_flow=true&state=6_xJ8vN-aWmcSLXKsSWWAyf0WpY0M8P5xOuFfp--c4c&originator=codex_vscode

and then forwards to this page, but it never finishes loading

https://auth.openai.com/sign-in-with-chatgpt/consent
and VScode Codex window stays like this

link that it generates inside Vscode when I click on "Sign in with ChatGPT"https://auth.openai.com/oauth/authorize?response_type=code&client_id=app_EMoamEEZ73f0CkXaXp7hrann&redirect_uri=http://localhost:1455/auth/callback&scope=openid profile email offline_access&code_challenge=hW0J5LNS_OLtJzD-a25mQC8So-G7jwLgNcrv8NtteSE&code_challenge_method=S256&id_token_add_organizations=true&codex_cli_simplified_flow=true&state=6_xJ8vN-aWmcSLXKsSWWAyf0WpY0M8P5xOuFfp--c4c&originator=codex_vscode
I'm having this issue for a couple of days and I need a solution to continue working with codex on my remote projects.

What steps can reproduce the bug?

I follow the standart authenticate process as I select "sign in with chatgpt" option, it directs me to a link where I enter my username and password and then after successfully logged in, it opens a consent screen to click on Continue

and then it opens this page first when I click on continue

https://auth.openai.com/oauth/authorize?response_type=code&client_id=app_EMoamEEZ73f0CkXaXp7hrann&redirect_uri=http://localhost:1455/auth/callback&scope=openid profile email offline_access&code_challenge=hW0J5LNS_OLtJzD-a25mQC8So-G7jwLgNcrv8NtteSE&code_challenge_method=S256&id_token_add_organizations=true&codex_cli_simplified_flow=true&state=6_xJ8vN-aWmcSLXKsSWWAyf0WpY0M8P5xOuFfp--c4c&originator=codex_vscode

and then forwards to this page, but it never finishes loading

https://auth.openai.com/sign-in-with-chatgpt/consent
and VScode Codex window stays like this

link that it generates inside Vscode when I click on "Sign in with ChatGPT"https://auth.openai.com/oauth/authorize?response_type=code&client_id=app_EMoamEEZ73f0CkXaXp7hrann&redirect_uri=http://localhost:1455/auth/callback&scope=openid profile email offline_access&code_challenge=hW0J5LNS_OLtJzD-a25mQC8So-G7jwLgNcrv8NtteSE&code_challenge_method=S256&id_token_add_organizations=true&codex_cli_simplified_flow=true&state=6_xJ8vN-aWmcSLXKsSWWAyf0WpY0M8P5xOuFfp--c4c&originator=codex_vscode

What is the expected behavior?

That the web page says the authencciate process is completed and I can start using codex on VS Code

Additional information

_No response_

View original on GitHub ↗

9 Comments

github-actions[bot] contributor · 8 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #5668
  • #4265
  • #4230
  • #4034
  • #5283

Powered by Codex Action

AlmarionAI · 8 months ago

fixed the issye via chatgpt as below

You’re running into a common issue when using Codex (or ChatGPT-related extensions) with VSCode Remote - SSH: The authentication flow tries to open http://localhost:1455/auth/callback on your LOCAL machine, but in a remote SSH environment, the extension is actually running on the REMOTE server. This means the “localhost” callback is targeting your server—not your computer—causing the authentication to hang.

Why It Happens
The browser on your Mac is trying to reach localhost:1455, but what’s actually running the Codex listener is the remote server, not your Mac.

Since your local browser can’t access the remote server’s localhost, the auth process stalls at the consent screen.

How to Solve It
Option 1: Use SSH Port Forwarding

Close all authentication attempts in VSCode and in your browser.

Set up SSH port forwarding so your local port 1455 maps to the remote’s 1455: If using terminal for SSH, connect like:

ssh -L 1455:localhost:1455 username@your-remote-host
This tunnels traffic from your local localhost:1455 to the remote.

Restart the Codex sign-in flow in VSCode. When the browser opens localhost:1455, it will correctly reach the remote’s callback. Now you should be able to complete authentication.

Option 2: Run Codex Locally for Authentication

Temporarily run VSCode or Codex CLI locally instead of remotely, complete authentication, then copy any generated token (if available) to your remote server’s environment.

For many extensions, however, only the first approach (port forwarding) allows direct sign-in for VSCode Remote work.

Other Important Checks
Make sure you’re not running a VPN or firewall that would block SSH port forwarding.

Ensure your remote host allows opening port 1455 for this callback.

Try incognito mode to avoid session mix-up in your browser if you repeat the process.

IZSkiSurfer · 7 months ago

There is one further trap for young players... If you have multiple remote instances running one of them might already has taken your port 1455. In that case VSCode will silently take the next free port and you'll again be stuck at the login.

vfk-rw · 5 months ago
There is one further trap for young players... If you have multiple remote instances running one of them might already has taken your port 1455. In that case VSCode will silently take the next free port and you'll again be stuck at the login.

Any fix or workaround for this? I regularly work on multiple remote-ssh instances of Codex. Is it possible to have some manual auth, paste a string or something instead of relying on the callback?

etraut-openai contributor · 5 months ago

@vfk-rw, you can use the headless device login mechanism described here.

dsgepers · 4 months ago
There is one further trap for young players... If you have multiple remote instances running one of them might already has taken your port 1455. In that case VSCode will silently take the next free port and you'll again be stuck at the login.

Actually this helped me alot, modified the port to 1456 twice, and it resolved. Thanks

hxflyer · 4 months ago

Spend me a while to get it work, almost give up. here is the solution:
1 In your remote ssh vscode window, click login in button of the codex extention, it will open local browser and jump to a login page.
2 Copy the link from local browser, open vscode integrated browser in your remote vscode window ( https://code.visualstudio.com/docs/debugtest/integrated-browser )
3 Paste the login link to the integrated browser in your remote vscode
4 Input username , password, login, click next.. next...
5 Done!

btemoshir · 4 months ago
fixed the issye via chatgpt as below You’re running into a common issue when using Codex (or ChatGPT-related extensions) with VSCode Remote - SSH: The authentication flow tries to open http://localhost:1455/auth/callback on your LOCAL machine, but in a remote SSH environment, the extension is actually running on the REMOTE server. This means the “localhost” callback is targeting your server—not your computer—causing the authentication to hang. Why It Happens The browser on your Mac is trying to reach localhost:1455, but what’s actually running the Codex listener is the remote server, not your Mac. Since your local browser can’t access the remote server’s localhost, the auth process stalls at the consent screen. How to Solve It Option 1: Use SSH Port Forwarding Close all authentication attempts in VSCode and in your browser. Set up SSH port forwarding so your local port 1455 maps to the remote’s 1455: If using terminal for SSH, connect like: ssh -L 1455:localhost:1455 username@your-remote-host This tunnels traffic from your local localhost:1455 to the remote. Restart the Codex sign-in flow in VSCode. When the browser opens localhost:1455, it will correctly reach the remote’s callback. Now you should be able to complete authentication. Option 2: Run Codex Locally for Authentication Temporarily run VSCode or Codex CLI locally instead of remotely, complete authentication, then copy any generated token (if available) to your remote server’s environment. For many extensions, however, only the first approach (port forwarding) allows direct sign-in for VSCode Remote work. Other Important Checks Make sure you’re not running a VPN or firewall that would block SSH port forwarding. Ensure your remote host allows opening port 1455 for this callback. Try incognito mode to avoid session mix-up in your browser if you repeat the process.

THIS WORKED!

ankur0101 · 3 months ago

#ssh -L 1455:localhost:1455 username@your-remote-host

What is the your-remote-host here? I am trying to login to codex via github codespace which cannot be a remote host