Answer: Prefer device code authentication (beta): in the interactive login UI choose **Sign in with Device Code**, or run `codex login --device-auth` directly. If that doesn't work, use a fallback method such as authenticating locally and copying your auth cache. Status: Confirmed Entry: tool/codex/troubleshooting/headless-login Revision: 1 Digest: sha256:2c1a37b475089b3b (changes whenever the content changes) Timeline: Created: 2026-11-13T03:47:39Z Last changed: 2026-11-13T03:47:39Z Last verified: 2026-11-20T13:35:16Z Next check: 2026-11-21T13:35:16Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of preferred method | device code authentication (beta) | [1] | 2026-11-20 interactive UI option | Sign in with Device Code | [1] | 2026-11-20 command | codex login --device-auth | [1] | 2026-11-20 fallback method | Authenticate locally and copy your auth cache | [1] | 2026-11-20 auth cache path | ~/.codex/auth.json | [1] | 2026-11-20 Sources: [1] OpenAI. "Authentication". https://learn.chatgpt.com/docs/auth.md Role: primary. Accessed: 2026-11-20T13:35:16Z Quote: "prefer device code authentication (beta)" (Supports: preferred method) Quote: "In the interactive login UI, choose **Sign in with Device Code**" (Supports: interactive UI option) Quote: "run `codex login --device-auth` directly" (Supports: command) Quote: "Fallback: Authenticate locally and copy your auth cache" (Supports: fallback method) Quote: "Confirm the login cache exists at `~/.codex/auth.json`." (Supports: auth cache path) Snapshot SHA-256: 67d3f0c64897ea26b48e62a634ced7dbd2763a47104e12a0923cc528986de588 (captured 2026-11-13T03:47:37Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-13T03:47:39Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T13:35:16Z. No independent second source is configured for this entry Last successful check: 2026-11-20T13:35:16Z Last attempt: 2026-11-20T13:35:16Z Notes and limitations: Extracted automatically from a single official source (section "Login on headless devices"). Related: https://latestn.com/tool/codex/troubleshooting/host-not-visible-on-phone Why don't I see my host on my phone in Codex remote connections, and how do I fix it? https://latestn.com/tool/codex/troubleshooting/large-repos-slow-in-wsl Why do large repositories feel slow in WSL when using Codex? https://latestn.com/tool/codex/troubleshooting/migrate-nfs-home How do I migrate an existing Codex home directory on NFS to avoid SQLite corruption? https://latestn.com/tool/codex/troubleshooting/exit-codes What exit codes does the Codex Security CLI return? https://latestn.com/tool/codex/troubleshooting/fix-input-monitoring-macos How do I fix Input Monitoring permission issues for Codex Micro on macOS? https://latestn.com/tool/codex/troubleshooting/fix-windows-error-1385 How do I fix Windows error 1385 when using the Codex sandbox? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:47:39Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/codex/troubleshooting/headless-login/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/codex/troubleshooting/headless-login POST: https://latestn.com/dispute/tool/codex/troubleshooting/headless-login with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/codex/troubleshooting/headless-login?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I sign in to Codex on a headless device? Revision 1, last verified 2026-11-20T13:35:16Z. https://latestn.com/tool/codex/troubleshooting/headless-login (accessed 2026-11-21T09:55:00Z). @misc{LatestN_tool_codex_troubleshooting_headless_login_r1, title = {How do I sign in to Codex on a headless device?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/codex/troubleshooting/headless-login}}, note = {Revision 1; digest sha256:2c1a37b475089b3b; last verified 2026-11-20T13:35:16Z; accessed 2026-11-21T09:55:00Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/codex/troubleshooting/headless-login