claude-code - 💡(How to fix) Fix [BUG] OAuth error: Request failed with status code 400 [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#54787Fetched 2026-04-30 06:36:01
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Participants
Timeline (top)
labeled ×4

Error Message

OAuth error: Request failed with status code 400

Code Example

OAuth error: Request failed with status code 400
RAW_BUFFERClick to expand / collapse

Preflight Checklist

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

What's Wrong?

hi, hopefully someone has an idea how to fix the following. thanks in advance!

i am using vs code. installed the official extension "Claude Code for VS Code".

trying to log in using Anthropic Console account to use pay as you go api usage billing. i open the link in the browser and click authorize. but then immediately get the error OAuth error: Request failed with status code 400

Same behaviour if i copy and open the authorization link in the browser manually. i am getting the code which i should input in claude code in vs code to complete authorization. i do that but i also get the same error message after i submit that.

Behaviour is the same no matter if i use the ui or terminal.

Please help!


Claude Code Version 2.1.123:

VS Code Version: 1.118.0 (user setup) Commit: 9b8ae15a8cf95b9bce1b590b42954530f440e816 Date: 2026-04-28T15:54:22-07:00 Electron: 39.8.8 ElectronBuildId: 13870025 Chromium: 142.0.7444.265 Node.js: 22.22.1 V8: 14.2.231.22-electron.0 OS: Windows_NT x64 10.0.26200

What Should Happen?

Authorization should finish successfully 😅

Error Messages/Logs

OAuth error: Request failed with status code 400

Steps to Reproduce

Try to login

Claude Model

None

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.123

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

Same behaviour in windows powershell (with and without admin rights)

extent analysis

TL;DR

The issue is likely related to an invalid or malformed OAuth request, resulting in a 400 status code error, and verifying the authorization link and parameters may help resolve the issue.

Guidance

  • Verify that the authorization link generated by the Claude Code extension is correct and properly formatted.
  • Check the parameters passed in the authorization request, such as client ID, redirect URI, and scope, to ensure they are valid and match the expected values.
  • Try to authorize using a different browser or environment to isolate if the issue is specific to the current setup.
  • Review the Anthropic API documentation to ensure that the OAuth flow is implemented correctly and that all required parameters are included.

Example

No code snippet is provided as the issue is related to the OAuth flow and authorization link, which is not explicitly shown in the issue body.

Notes

The issue may be related to a misconfiguration or invalid parameter in the OAuth request, but without more information about the authorization link and parameters, it's difficult to provide a more specific solution.

Recommendation

Apply workaround: Verify the authorization link and parameters to ensure they are correct and valid, and try authorizing using a different browser or environment to isolate the issue. This is recommended as it allows for further troubleshooting and potential resolution without requiring an upgrade or significant changes.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] OAuth error: Request failed with status code 400 [1 participants]