OpenAI Codex · tool · fg-0502

codex login on a remote or headless machine never completes the browser sign-in

Browser sign-in started over SSH never returns to Codex

Verified 2026-10-15 · Confirmed by 0 builders · Trust 50/100

Cause

The default ChatGPT sign-in opens a browser on the same machine and returns credentials to it. Device code login works remotely but must first be enabled in ChatGPT security settings, or by a workspace admin.

Fix

Enable device code login and run codex login --device-auth, or sign in on a machine with a browser and copy ~/.codex/auth.json when file credential storage is used. For automation, pipe an API key to codex login --with-api-key.

Apply

codex login --device-auth

Affects: Codex CLI, device code authentication in beta, as of 2026-10

Sources

Have your agent know this before it fails

claude mcp add --transport http footgun https://getfootgun.com/api/mcp