Skip to content

[BUG] Claude Code OAuth Authentication Fails - "OAuth account information not found in config" #1484

Description

@hellohqd

Environment

  • Claude Code version: 1.0.6
  • Operating System: macOS
  • Node.js version: v22.16.0
  • npm version: 10.9.2
  • Account type: Claude Max subscription
  • Network environment: Corporate network with specific routing requirements

Description

Claude Code fails to complete OAuth authentication in my network environment, consistently showing the error:

OAuth error: Failed to fetch user roles: OAuth account information not found in config

Steps to Reproduce

  1. Install Claude Code: npm install -g @anthropic-ai/claude-code
  2. Run Claude Code: claude
  3. Select theme (any option)
  4. Select login method: "2. Claude app (requires Max subscription)"
  5. Browser opens OAuth page successfully
  6. Complete authorization (shows "You're all set up for Claude Code")
  7. Return to terminal
  8. Error appears: OAuth error: Failed to fetch user roles: OAuth account information not found in config

Expected Behavior

After OAuth authorization, Claude Code should successfully authenticate and start normally.

Actual Behavior

Despite successful OAuth flow in browser, Claude Code fails to save or retrieve the authentication configuration, resulting in the error message. The browser shows "You're all set up" but the CLI cannot proceed.

Additional Context

  • The OAuth flow completes successfully in browser
  • Sometimes an authentication code is displayed to paste into Claude Code, but entering it doesn't resolve the issue
  • The error suggests the OAuth account information is not being properly saved to the config file
  • Message "Creating API key for Claude Code..." appears briefly before the error

Troubleshooting Attempted

  1. Complete uninstall and cleanup:
    npm uninstall -g @anthropic-ai/claude-code
    rm -rf ~/.claude
    rm -rf ~/.npm-global/lib/node_modules/@anthropic-ai/
    rm -rf ~/Library/Application\ Support/ClaudeCode
    npm cache clean --force
  2. Tried both login methods (Claude app & Anthropic Console) - same error
  3. Tested with different browsers (Safari, Chrome)
  4. Fresh install on clean system

Possible Cause

The issue appears to be related to Claude Code's OAuth callback handling or configuration file creation/reading after successful browser authentication.

Related Issues

Similar authentication issues reported by other users with Max subscriptions, suggesting this might be a broader issue with the OAuth implementation.

Metadata

Metadata

Assignees

Labels

area:authbugSomething isn't workinghas reproHas detailed reproduction stepsplatform:macosIssue specifically occurs on macOS

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions