[Bug] claude auth login does not complete on headless servers (SSH)

Resolved 💬 3 comments Opened Mar 18, 2026 by n24q02m Closed Mar 18, 2026

Description

claude auth login on headless server (via SSH) displays OAuth URL but never completes. CLI polls for token but polling fails.

Environment

  • Claude Code v2.1.77
  • Ubuntu 24.04, ARM64, SSH session

Steps to Reproduce

  1. SSH into headless server
  2. Run claude auth login
  3. Copy URL to browser on another machine
  4. Authorize in browser
  5. CLI never detects authorization (stays waiting indefinitely)

Expected

CLI detects authorization via polling or accepts pasted authorization code.

Workaround

Copy ~/.claude/.credentials.json from authenticated machine. Token includes refresh token for auto-renewal.

Suggestion

Support device code flow (like Azure CLI) or accept paste-back authorization code for headless environments.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗