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

Resolved 💬 27 comments Opened Aug 27, 2025 by petrosgeor Closed Oct 28, 2025
💡 Likely answer: A maintainer (aibrahim-oai, contributor) responded on this thread — see the highlighted reply below.

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.

<img width="1191" height="602" alt="Image" src="https://github.com/user-attachments/assets/7b28b82e-664e-43a0-8290-e8af5b5142ad" />

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.

View original on GitHub ↗

27 Comments

Wydoyolo · 10 months ago

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)

aibrahim-oai contributor · 10 months ago

Was it working before?

Wydoyolo · 10 months ago

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

Wydoyolo · 10 months ago

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

ashvardanian · 10 months ago

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

dancardverse · 10 months ago

Issue is still happening, any fixes?

me-here-now · 10 months ago

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.

pkorobov · 10 months ago

The same happens today with me :(

me-here-now · 10 months ago
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

pkorobov · 10 months ago

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

Copying local auth.json helped, thanks!

crypdick · 10 months ago

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.

SGudbrandsson · 9 months ago

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.

me-here-now · 9 months ago

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.

LordMoMA · 9 months ago

the issue persists, I still got stuck when login

me-here-now · 9 months ago
the issue persists, I still got stuck when login

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

expo411 · 9 months ago

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.

me-here-now · 9 months ago
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.

Wydoyolo · 9 months ago
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

epidemicz · 9 months ago

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

etraut-openai contributor · 8 months ago

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.

CasperJ · 8 months ago
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

moazbuilds · 8 months ago
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!

JonatanSahar · 7 months ago

I'm still getting this with latest:
At first I get

Token exchange failed: error sending request for url (https://auth.openai.com/oauth/token)

in the browser, after having logged into my account.
Following trials just hang after selecting a workspace and hitting Continue.

<img width="1466" height="669" alt="Image" src="https://github.com/user-attachments/assets/3b21de68-d9de-46f9-854d-a90b6f513b27" />

JonatanSahar · 7 months ago

This happens once in a while, and works in between.

Faraz9877 · 7 months ago

Just go to the Ports tab on your VSCode on different screens and make sure to remove all open port 1455s.

JonatanSahar · 7 months ago

This is for codex cli, unrelated to vs code.

On Sat, Dec 6, 2025, 23:16 Faraz Shahsavan @.***> wrote:

Faraz9877 left a comment (openai/codex#2763) <https://github.com/openai/codex/issues/2763#issuecomment-3621156744> Just go to the Ports tab on your VSCode on different screens and make sure to remove all open port 1455s. — Reply to this email directly, view it on GitHub <https://github.com/openai/codex/issues/2763#issuecomment-3621156744>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AEL3S3GJ3HGBN2X37SKPKFD4ANBUHAVCNFSM6AAAAACE52BVF2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTMMRRGE2TMNZUGQ> . You are receiving this because you commented.Message ID: @.***>
etraut-openai contributor · 7 months ago

I'm going to lock this issue.

As I mentioned above, this issue covers a bunch of unrelated underlying issues, most of which have already been addressed.
If you are seeing a related problem, please open a new issue. This will help us diagnose and fix any remaining problems.