[BUG] Claude Code OAuth Authentication Fails - "OAuth account information not found in config"
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
- Install Claude Code:
npm install -g @anthropic-ai/claude-code - Run Claude Code:
claude - Select theme (any option)
- Select login method: "2. Claude app (requires Max subscription)"
- Browser opens OAuth page successfully
- Complete authorization (shows "You're all set up for Claude Code")
- Return to terminal
- 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
- Complete uninstall and cleanup:
``bash``
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
- Tried both login methods (Claude app & Anthropic Console) - same error
- Tested with different browsers (Safari, Chrome)
- 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.
47 Comments
Some things you can try:
https://api.anthropic.com? Claude Code makes a couple calls there for authentication.Update: Even single character commands like 'h' or 'pwd' result in the same error:
"API Error: Cannot convert argument to a ByteString because the character at index 0 has a value of 8217"
This happens with ANY input, suggesting a critical bug in Claude Code's character encoding handling.
Environment details:
There seems to be a different error here related to your input.
Can you share a screenshot of the API Error and also the result of
/status?Here's the screenshot showing both the API error and /status result:
<img width="570" alt="Image" src="https://github.com/user-attachments/assets/a06de5bd-aad1-4807-bf1a-dc811a6d2f80" />
Key observations:
The error happens with ANY input, suggesting the issue is in Claude Code's input handling before it reaches the API.
Ok I think there's something wrong with how the OAuth was saved. Can you try:
security delete-generic-password -a $USER -s "Claude Code-credentials"/loginagain.If that still doesn't work, I don't have many remaining ideas...
Thank you for the suggestion! It helped uncover the root cause:
What I discovered:
security delete-generic-passwordreturned "item could not be found" - meaning OAuth credentials were never saved to keychainTesting OAuth flow:
Two separate bugs identified:
The OAuth credentials not being in keychain is a symptom, not the cause - they can't be saved because the user role fetch fails with 403.
Environment: macOS, Max subscription, v1.0.11
You may be running into the following issue: https://www.anthropic.com/supported-countries
Thanks for your patience in debugging this with me.
Actually, based on the fact that you see "fetching user roles", you are likely going through the "Anthropic Console account" flow instead of the "Claude account with subscription" flow. Ensure that you are selecting "Claude account with subscription" if you want to use your Claude Max plan.
Fixed my issue. Thx
Sorry to reopen the issue but I am getting this right now, maybe related to the outage that you guys had today:
I am trying to use my claude code account. I've already removed the .claude files, reinstalled the npm package and logged out & back in, same deal.
Any ideas?
Must be an outage. I just encountered the same.
Same
Same here, time to hit the hay
Same
same
Hopping on the "same" bandwagon
same me too
same :)
Same
Same
Same
Same
seems to be working for me now
When your dealers phone stops working
lmaoooo all bros here
time to hit the gym
same here. I thought it was because I installed both the local and global versions of Claude Code by mistake, but it seems to be a bug.
<img width="681" height="140" alt="Image" src="https://github.com/user-attachments/assets/cc087959-e7cf-43a9-98b1-6a17ffe6989e" />
same issue here
I'm having the same issue with the exact same error message. Haven't logged in for a week... Definitely on Anthropic's side.
same issue.
same issue.
same please fix it
Facing the same issue as of today.
We paged our accounts oncall and are trying to address the issue ASAP.
same issue
Why hasn't Anthropic opened an issue I wonder? It's not showing as down on the status page...
https://status.anthropic.com/
ok its an outage then :)
Phew I thought it was just me
maybe i'm just lucky, but i re-authenticated and it's working now. Accessing via Claude Pro subscription in WSL
same here
its still happening right?
back up now
Same error here, happy to see I am not alone, and we are both happen on the same day.
The incident should now be resolved. Thank you for your patience.
\- Claude Code oncall
Still facing this issue. Have tried:
security delete-generic-password -a $USER -s "Claude Code-credentials"<img width="711" height="242" alt="Image" src="https://github.com/user-attachments/assets/a89b94ca-ddf6-4089-9425-c839d2130393" />
Facing this issue again today!
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.