codex icon indicating copy to clipboard operation
codex copied to clipboard

Codex CLI login stuck on 'Sign in with ChatGPT' screen

Open petrosgeor opened this issue 5 months ago • 6 comments

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.

Image

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.

petrosgeor avatar Aug 27 '25 10:08 petrosgeor

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)

Wydoyolo avatar Aug 27 '25 12:08 Wydoyolo

Was it working before?

aibrahim-oai avatar Aug 27 '25 16:08 aibrahim-oai

@aibrahim-oai Yes, it was working before just fine. Happened today that it's stuck upon clicking "Continue".

Wydoyolo avatar Aug 27 '25 16:08 Wydoyolo

Kept trying all day, using VPN and various browsers. Just went through. So at least for me it's fixed.

Wydoyolo avatar Aug 27 '25 23:08 Wydoyolo

I've been struggling the last couple of days. Sticking to Claude until this is resolved. PS: Same issue with 0.27.

ashvardanian avatar Aug 30 '25 09:08 ashvardanian

Issue is still happening, any fixes?

dancardverse avatar Sep 06 '25 09:09 dancardverse

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.

calhounit avatar Sep 09 '25 22:09 calhounit

The same happens today with me :(

pkorobov avatar Sep 15 '25 19:09 pkorobov

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

calhounit avatar Sep 15 '25 19:09 calhounit

Well, actually, that's exactly my case! Though it worked perfectly on a remote machine before.

Copying local auth.json helped, thanks!

pkorobov avatar Sep 16 '25 11:09 pkorobov

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.

crypdick avatar Sep 18 '25 15:09 crypdick

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.

SGudbrandsson avatar Sep 24 '25 11:09 SGudbrandsson

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.

calhounit avatar Sep 24 '25 15:09 calhounit

the issue persists, I still got stuck when login

LordMoMA avatar Sep 24 '25 17:09 LordMoMA

the issue persists, I still got stuck when login

Are you updated to the latest release? I am on 0.41.0

calhounit avatar Sep 24 '25 17:09 calhounit

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.

expo411 avatar Oct 14 '25 19:10 expo411

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.

calhounit avatar Oct 14 '25 20:10 calhounit

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

Wydoyolo avatar Oct 15 '25 04:10 Wydoyolo

I also just had to remove the port mapping in VS Code for 1455.

epidemicz avatar Oct 16 '25 20:10 epidemicz

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.

etraut-openai avatar Oct 28 '25 00:10 etraut-openai

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

CasperJ avatar Nov 14 '25 09:11 CasperJ

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!

moazbuilds avatar Nov 14 '25 21:11 moazbuilds