OAuth login: CLI times out waiting for callback despite successful browser authorization

Status Fixed / completed
Reported on v2.1.92
Maintainer reply None cached
Activity 12 comments · opened Apr 6, 2026 · closed Apr 28, 2026

Description

After clicking "Authorize" in the browser, the OAuth flow completes successfully (browser shows success page), but the CLI times out waiting for the callback and never completes authentication.

Environment

  • Claude Code version: 2.1.92
  • OS: macOS
  • Install method: npm (global)
  • Browser: Default browser

Steps to Reproduce

  1. Run claude auth login
  2. Browser opens the OAuth authorization page
  3. Click "Authorize" — browser shows success
  4. CLI shows: Login failed: timeout of 15000ms exceeded

What I've tried

  • claude auth logout + claude auth login
  • rm -rf ~/.claude/auth*
  • Different browsers (Safari, Chrome)
  • Incognito window
  • Disabling firewall
  • Manually copying the OAuth URL
  • claude update (already on latest 2.1.92)

Errors observed

  • First attempts: OAuth error: Request failed with status code 500
  • Later attempts: OAuth error: Request failed with status code 400
  • Browser authorization page once showed: "Autorizzazione non riuscita - Internal server error"
  • Most attempts: browser succeeds but CLI times out

Expected Behavior

CLI should receive the OAuth callback and complete authentication after browser authorization succeeds.

Additional Context

The --no-browser flag is not available in this version. A manual code-paste flow (like other CLI tools offer) would help work around this issue.

View original on GitHub ↗

12 Comments

github-actions[bot] · 4 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/44252
  2. https://github.com/anthropics/claude-code/issues/33258
  3. https://github.com/anthropics/claude-code/issues/33226

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

rcconsult · 4 months ago

/v1/oauth/62bdd324-23cd-497e-af45-1ef019164a0b/authorize:1 Failed to load resource: the server responded with a status of 500 ()
4511-84f97842c4096e0e.js:12 [REACT_QUERY_CLIENT] QueryClient error: a: Internal server error
at n (5741-e0df12e868d24a1c.js:1:95179)
at 5741-e0df12e868d24a1c.js:1:100054
at async Object.mutationFn (5741-e0df12e868d24a1c.js:1:100872)

tomureka · 4 months ago

exactly same issue here.

Arman-Zohrabyan · 4 months ago

Same

notmean11 · 4 months ago

same here

rcconsult · 4 months ago
same here

Switch to vscode ext, it seems working for now

yenachar · 4 months ago

Same, running Claude Code under Linux.

ceelo404 · 4 months ago

same issue

tzyyung · 4 months ago

same

rcconsult · 4 months ago

working now

YosefHayim · 4 months ago

Additional data point: macOS — no 15s timeout, but same “browser OK / CLI not logged in” failure

On macOS, Claude Max, Claude Code 2.1.92 (npm global), after \claude auth login\:

  1. Browser authorization completes; terminal prints Login successful.
  2. Immediately running \claude auth status --text\ returns Not logged in (not always a visible timeout — session never persists).
  3. Interactive \claude\ still shows API Usage Billing and Not logged in · Please run /login.
claude auth logout
claude auth login
claude auth status --text   # Not logged in right after Login successful

OAuth URL from CLI includes \redirect_uri=https://platform.claude.com/oauth/code/callback\.

Repro hygiene: Avoid \alias claude='claude --bare'\ during repro (\command claude\ or remove alias).

Strongly overlaps with #44585 (login success then immediate “not logged in”). Posting here to tie macOS + non-timeout variant to this callback/persistence thread.

github-actions[bot] · 3 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.