Unable to Authenticate with ChatGPT account

Resolved 💬 12 comments Opened Aug 7, 2025 by Shaurya-Sethi Closed Oct 27, 2025
💡 Likely answer: A maintainer (ae-openai, contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

0.16.0

Which model were you using?

-

What platform is your computer?

Linux 6.6.87.2-microsoft-standard-WSL2 x86_64 x86_64

What steps can reproduce the bug?

  1. start codex cli with codex after a fresh install
  2. choose option 1. for signing in (Sign in with ChatGPT)

What is the expected behavior?

Expected the browser to open up automatically for authentication which did not happen.

<img width="699" height="170" alt="Image" src="https://github.com/user-attachments/assets/d2e62cce-d83f-4722-836e-790ef419e301" />

What do you see instead?

On following manual steps as seen in the image, I get errors and am unable to log in - sometimes logging in is successful, but then it redirects to localhost/... and nothing happens after.

<img width="525" height="485" alt="Image" src="https://github.com/user-attachments/assets/02231afe-72cf-413b-bbf5-a2b8ff673f59" />
<img width="1916" height="1004" alt="Image" src="https://github.com/user-attachments/assets/d2a55151-772b-438d-af2c-0002e9aa6893" />
<img width="594" height="708" alt="Image" src="https://github.com/user-attachments/assets/cffd80d0-32b0-49b8-a378-8015787ae85e" />

<img width="1899" height="483" alt="Image" src="https://github.com/user-attachments/assets/302a0386-8656-4a49-80f5-2b9c803cebda" />

Additional information

Since the brower didn't automatically start on the specified localhost port, I visited the url and successfully logged in and then it failed again in this exact sequence:

<img width="745" height="136" alt="Image" src="https://github.com/user-attachments/assets/a15cac27-5d5b-4b03-9186-80ce492fdbed" />

<img width="574" height="606" alt="Image" src="https://github.com/user-attachments/assets/99c48aed-70ec-416a-9426-69a91320503f" />
<img width="771" height="276" alt="Image" src="https://github.com/user-attachments/assets/2d949a04-a1b4-4808-953b-e64b777dafd3" />

View original on GitHub ↗

12 Comments

leoisadev1 · 11 months ago

<img width="2045" height="1055" alt="Image" src="https://github.com/user-attachments/assets/2722fcbe-d725-40b2-803a-048f8e494613" />

For me just opens url in terminal and I can't do anything

adrianflores2 · 11 months ago

In my case, I get to log in with my ChatGPT account but even though I'm on Plus plan, CODEX connects to my API Org and uses API quota instead.

LuigiPagani · 11 months ago

Login seems borken, is it supposed to work also for browerless machines?

ro-nin-labs · 11 months ago

having the same issue. really weird because i had no trouble with claude code or gemini cli

Shaurya-Sethi · 11 months ago

@ro-nin-labs If you're also on windows, install Firefox inside of WSL and then try codex login and ignore warnings about gio.

This worked for me

bsturk · 11 months ago

Having the same issue, using a ssh tunnel as mentioned on the readme.md didn't work either. Just trying to auth running on a headless Linux server (so no way to launch browser on that machine).

Zenchess · 11 months ago

I've been trying to solve this issue for at least 2 hours with the help of chatgpt...nothing works. The port codex uses is literally a windows reserved port - possibly even by WSL itself or hyper-v or something. I even tried using curl -v and the url that is returned after I log in, but even that does not work. I'm going to try installing firefox in wsl, my last try before I give up entirely

ae-openai contributor · 11 months ago

@Zenchess what error are you seeing, and is that on 0.22, which has some fixes?

nitish-raj · 10 months ago

Hi - I have the same issue with my Enterprise account. Do I need to ask the admin to enable a feature, or are enterprise accounts still unable to use the CLI? I can access the codex on the browser.

Zenchess · 10 months ago
Hi - I have the same issue with my Enterprise account. Do I need to ask the admin to enable a feature, or are enterprise accounts still unable to use the CLI? I can access the codex on the browser.

installing firefox in the wsl (i'm assuming you're trying to run this from wsl), solved the problem for me

ThomSMG · 10 months ago
Logging into Codex CLI and Codex IDE with a ChatGPT Enterprise or Edu account is still rolling out and is currently not available.

https://developers.openai.com/codex/enterprise

Not sure if this is a reaction on this or similar issues. But that at least solves the mistery for the Ent accounts.

etraut-openai contributor · 8 months ago

It looks like this thread involves a number of (likely unrelated) problems. I suspect that most have been fixed in the intervening releases, so I'm going to close the issue. If you experience a similar problem, please open a new bug report with details.