OAuth login broken for remote/headless server setups
Status Fixed / completed
Maintainer reply ✓ Yes — claude[bot]
Workaround ✓ Mentioned in description ↑
Activity 7 comments · opened Apr 3, 2026 · closed May 1, 2026
💡 Likely answer: A maintainer (claude[bot], contributor)
responded on this thread — see the highlighted reply below.
Description
claude auth login OAuth flow is broken when Claude Code runs on a remote server and the browser is on a separate local machine. The authorization code callback is not being exchanged for a token.
Setup
- Claude Code running on a remote Linux server (SSH)
- Browser on a separate local machine
- Using Remote Control feature, which requires full-scope OAuth login (not long-lived tokens)
Steps to Reproduce
- Run
claude auth loginon a remote server - OAuth flow directs to browser on local machine
- Browser completes authorization, receives callback URL:
https://platform.claude.com/oauth/code/callback?code=<code>&state=<state> - The authorization code is never exchanged — the local listener on the server doesn't receive the callback
Expected Behavior
The OAuth flow should complete successfully, exchanging the authorization code for a full-scope token, even when the browser and CLI are on different machines.
Actual Behavior
The callback URL isn't routed back to the CLI's listener on the remote server. The user sees the code in the browser URL but has no way to manually provide it to the CLI. Remote Control reports: "Remote Control requires a full-scope login token."
Notes
- This reportedly worked previously and has regressed
- Workarounds like SSH port forwarding or copying credentials from a local machine exist but shouldn't be necessary
- A device-code flow or manual code-paste option would solve this for headless/remote environments
7 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Same issue when running Claude Code in WSL.
same in openshell
bump
Bump?
This issue was fixed as of version 2.1.126.
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.