Codex Desktop macOS authentication fails: browser bridge cannot open OAuth URL and callback listener is not started
Summary
Codex Desktop on macOS cannot complete ChatGPT authentication.
The app generates a valid OAuth URL but fails to open it through its internal browser bridge:
[link-opening] Failed to open link
errorMessage="Failed to open URL"
initiator=open_in_browser_bridge
At the same time, the expected local OAuth callback listener on localhost:1455 is not started.
Because of this, I cannot sign in to Codex Desktop at all.
Environment
- macOS: 26.6.1
- Apple Silicon Mac
- Codex / ChatGPT Desktop version:
26.820.60940 - Bundle version:
7119 - Bundle identifier:
com.openai.codex - URL scheme registered by the app:
codex://
Background
I had been using Codex Desktop normally for some time.
Before this authentication failure occurred, I had already noticed a related issue: opening Profile from Codex settings sometimes failed with a macOS application/opening error.
Later I changed the email address on my OpenAI account. This invalidated the existing Codex session, which is expected.
After that, Codex required me to sign in again, but the desktop authentication flow no longer worked.
I do not think changing the email itself is necessarily the root cause, because the external-link/Profile opening problem existed before the email change. The email change appears to have invalidated the old session and exposed the existing authentication/open-link issue.
Actual behavior
When Codex starts, the previous refresh token is rejected:
Failed to refresh token: 401 Unauthorized
"Your session has ended. Please log in again."
code: "refresh_token_invalidated"
The app then reports that no valid ChatGPT token is available:
app_server_connection.auth_status_result
authMethod=chatgpt
hasToken=false
nullReason=auth_token_missing
refreshToken=true
tokenExpiryState=missing
Backend requests subsequently fail with 401 Unauthorized, for example:
desktop_fetch_auth_401
target="GET https://chatgpt.com/backend-api/wham/accounts/check"
and:
chatgpt-account-lookup
accountsHttpStatus=401
authenticatedAccountPresent=false
failureType=account_info_token_unavailable
When I press Sign in with ChatGPT, Codex creates an OAuth URL but fails to open it:
[link-opening] Failed to open link
conversationId=undefined
errorMessage="Failed to open URL"
errorName=Error
initiator=open_in_browser_bridge
url=https://chatgpt.com/codex/desktop-auth?authorize_url=...
The OAuth redirect URI generated by Codex is:
http://localhost:1455/auth/callback
However, immediately after triggering login, there is no process listening on port 1455.
Command:
lsof -nP -iTCP:1455 -sTCP:LISTEN
Result:
(no output)
So the app appears to both:
- fail to open the OAuth URL through
open_in_browser_bridge; - fail to start the local callback listener on port
1455.
Important diagnostic detail
Opening normal HTTPS URLs from macOS works correctly.
Both of these commands successfully open the browser:
open "https://chatgpt.com"
open -a Safari "https://chatgpt.com"
So the system HTTP/HTTPS handler itself appears to work.
The problem seems specific to Codex Desktop's internal browser-opening/authentication flow.
Steps to reproduce
- Install Codex / ChatGPT Desktop on macOS.
- Start the app while no valid ChatGPT session exists.
- Click Sign in with ChatGPT.
- Codex attempts to start OAuth.
- The app fails to open the authentication URL.
- Authentication cannot proceed.
localhost:1455is not listening for the OAuth callback.
Expected behavior
Clicking Sign in with ChatGPT should:
- start the local callback listener;
- open the authentication URL in the default browser;
- complete OAuth;
- return the session to Codex Desktop;
- sign the user into the existing ChatGPT account.
What I already tried
I have already tried all of the following:
- completely quitting the app;
- removing ChatGPT/Codex;
- removing associated application data;
- reinstalling the latest version;
- rebooting macOS;
- re-registering the app with Launch Services;
- verifying the
codex://URL scheme; - testing the app executable directly;
- testing normal HTTP/HTTPS URL opening;
- temporarily removing
OPENAI_API_KEYfrom the shell environment; - retrying authentication after all of the above.
A full clean reinstall and reboot did not fix the issue.
Launch Services / bundle checks
The installed app reports:
CFBundleShortVersionString = 26.820.60940
CFBundleIdentifier = com.openai.codex
Its URL schemes include:
codex
http
https
The executable is present and valid:
/Applications/ChatGPT.app/Contents/MacOS/ChatGPT:
Mach-O 64-bit executable arm64
Additional note
Before the current login failure, opening Profile from Codex settings could also trigger an application-opening error. This may indicate that the same open_in_browser_bridge / external-link handling issue existed before the authentication session was invalidated.
Please let me know if there are additional logs or diagnostics I can provide.
1 Comment
Workaround found: authenticating through Codex CLI restores Desktop
I found a workaround that immediately restored the Desktop app.
The Desktop app itself was unable to start/complete the OAuth flow, but the Codex CLI could.
Steps that fixed it:
npm install -g @openai/codex).codex logout(it reportedNot logged in).codex login.http://localhost:1455and opened/completed the browser OAuth flow.Successfully logged in.npm uninstall -g @openai/codex), and Desktop continued to work.This strongly suggests the Desktop app and CLI share/reuse the resulting authentication state, while the Desktop app's own login flow is failing before it can obtain a fresh token. In particular, CLI successfully starts the
localhost:1455callback listener that Desktop was not starting in my previous tests.So for affected users, a temporary workaround appears to be:
After
codex loginsucceeded, the previously broken Desktop app started working immediately.