[BUG] Linux OAuth flow fails for subscription users due to unsupported org:create_api_key scope

Resolved 💬 3 comments Opened Apr 7, 2026 by 2sip Closed Apr 10, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Version: 2.1.92
OS: Linux (headless server)
Account type: Pro/Max subscription

Problem:
Claude Code on Linux generates an OAuth URL containing the scope org:create_api_key which is not supported by claude.ai for subscription accounts. This causes an "Invalid OAuth request" error when trying to authenticate, making it impossible to log in on headless Linux servers.

Steps to reproduce:

  1. Install Claude Code on a headless Linux server
  2. Run claude
  3. Select option 1 (Claude account with subscription)
  4. Copy the generated OAuth URL and open in a browser
  5. See "Invalid OAuth request" error

Root cause:
The generated URL includes org%3Acreate_api_key in the scope parameter. Removing this scope from the URL manually allows the OAuth flow to complete successfully.

Expected behavior:
Claude Code should not request the org:create_api_key scope for subscription-based logins, only for Console/API accounts.

Workaround:
Manually remove org%3Acreate_api_key+ from the OAuth URL before opening it in the browser.

What Should Happen?

claude code should honor the permanent token in the env which it doe snot

Error Messages/Logs

Steps to Reproduce

N/A

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

claude --version 2.1.92 (Claude Code)

Platform

Other

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Other

Additional Information

_No response_

View original on GitHub ↗

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