Codex CLI login stuck on 'Sign in with ChatGPT' screen
What version of Codex is running?
codex-cli 0.25.0
Which model were you using?
What platform is your computer?
Linux 5.4.0-216-generic x86_64 x86_64
What steps can reproduce the bug?
When trying to log in to Codex CLI, the authentication flow gets stuck on the "Sign in to Codex CLI with ChatGPT" screen. The process never completes, and I cannot proceed to use the CLI.
What is the expected behavior?
No response
What do you see instead?
No response
Additional information
I'm a chatGPT pro user. I've tried multiple times to log in this way, but the process always gets stuck in this phase.
Sorry to say, but I'm glad I'm not the only one. Also using latest version 0.25.0 (5.14.0-503.31.1.el9_5.x86_64)
Was it working before?
@aibrahim-oai Yes, it was working before just fine. Happened today that it's stuck upon clicking "Continue".
Kept trying all day, using VPN and various browsers. Just went through. So at least for me it's fixed.
I've been struggling the last couple of days. Sticking to Claude until this is resolved. PS: Same issue with 0.27.
Issue is still happening, any fixes?
This has been happening to me too. Various browsers, etc. I sign in to chatgpt with Google, not sure if that makes a difference. When I click continue it just spins endlessly, even left it overnight and was still spinning the next day.
The same happens today with me :(
The same happens today with me :(
This fix for me was this url, specifically copying a good auth.json file manually to the ssh server
https://github.com/openai/codex/blob/main/docs/authentication.md#connecting-on-a-headless-machine
Well, actually, that's exactly my case! Though it worked perfectly on a remote machine before.
Copying local auth.json helped, thanks!
I just had this problem, which is weird because it was working yesterday. Copying the local auth.json worked for Codex CLI, and to get it working with the Cursor Codex extension I had to uninstall and reinstall.
I had the same issue locally.
The login website just hung after I clicked continue.
I'm using the fish shell, so I tried opening bash, then running codex CLI. Lo and behold - logging in worked then.
So this is something related to what shell you're running, or the env vars set by different shells.
Quick follow-up: I believe they may have fixed this issue as I have not had to manually copy my auth.json file to a few ssh servers that I have recently installed Codex CLI on. The auth flow seems to work properly now, at least for me.
the issue persists, I still got stuck when login
the issue persists, I still got stuck when login
Are you updated to the latest release? I am on 0.41.0
I ran into this issue and figured out what was happening.
When launching through Visual Studio Code, I checked the Ports tab and saw this:
Port 1455 → Forwarded to 1456
That’s the problem — it needs to forward 1455 → 1455.
In my case, another VS Code window was already using port 1455 on my local machine, so the new session couldn’t bind to it and the authentication hung.
Fix: Close all other VS Code windows (or delete the existing port mapping) so that the session you’re authenticating can correctly forward port 1455 to 1455.
I ran into this issue and figured out what was happening.
When launching through Visual Studio Code, I checked the Ports tab and saw this:
Port 1455 → Forwarded to 1456
That’s the problem — it needs to forward 1455 → 1455.
In my case, another VS Code window was already using port 1455 on my local machine, so the new session couldn’t bind to it and the authentication hung.
Fix: Close all other VS Code windows (or delete the existing port mapping) so that the session you’re authenticating can correctly forward port 1455 to 1455.
That's great insight, thanks for sharing.
I ran into this issue and figured out what was happening.
When launching through Visual Studio Code, I checked the Ports tab and saw this:
Port 1455 → Forwarded to 1456
That’s the problem — it needs to forward 1455 → 1455.
In my case, another VS Code window was already using port 1455 on my local machine, so the new session couldn’t bind to it and the authentication hung.
Fix: Close all other VS Code windows (or delete the existing port mapping) so that the session you’re authenticating can correctly forward port 1455 to 1455.
Worked for me as well
I also just had to remove the port mapping in VS Code for 1455.
Thanks for reporting the issue. I think the thread covers a couple of different issues. We had some earlier bugs that have since been fixed. Codex still requires localhost port 1455 for login, but it does a better job dealing with the situation where another instance of codex is already running the login server, and it better handles the case where it cannot acquire the port. I'm going to close out the issue. If you see a related problem, please open a new issue.
I ran into this issue and figured out what was happening.
When launching through Visual Studio Code, I checked the Ports tab and saw this:
Port 1455 → Forwarded to 1456
That’s the problem — it needs to forward 1455 → 1455.
In my case, another VS Code window was already using port 1455 on my local machine, so the new session couldn’t bind to it and the authentication hung.
Fix: Close all other VS Code windows (or delete the existing port mapping) so that the session you’re authenticating can correctly forward port 1455 to 1455.
Same here.
I got two VS Code instances running as I was working on two projects each in it's own Dev Container. The first one occupies 1455 and the next one takes 1456 - and fails
I ran into this issue and figured out what was happening.
When launching through Visual Studio Code, I checked the Ports tab and saw this:
Port 1455 → Forwarded to 1456
That’s the problem — it needs to forward 1455 → 1455.
In my case, another VS Code window was already using port 1455 on my local machine, so the new session couldn’t bind to it and the authentication hung.
Fix: Close all other VS Code windows (or delete the existing port mapping) so that the session you’re authenticating can correctly forward port 1455 to 1455.
Thanks for sharing!