Skip to content

cannot complete authentication with "sign in with chatgpt" option #5673

Closed

Description

@AlmarionAI

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

Activity

  1. added
    extension
    on Oct 25, 2025
  2. added
    bug
    on Oct 25, 2025
  3. AlmarionAI commented on Oct 25, 2025

    @AlmarionAI
    Author

    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.

  4. IZSkiSurfer commented on Dec 1, 2025

    @IZSkiSurfer

    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.

  5. vfk-rw commented on Feb 6, 2026

    @vfk-rw

    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?

  6. etraut-openai commented on Feb 6, 2026

    @etraut-openai
    Contributor

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

  7. dsgepers commented on Feb 23, 2026

    @dsgepers

    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

  8. hxflyer commented on Feb 25, 2026

    @hxflyer

    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!

  9. btemoshir commented on Mar 12, 2026

    @btemoshir

    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!

  10. ankur0101 commented on Apr 14, 2026

    @ankur0101

    #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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugextension

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions