[BUG] Authorization failed: Redirect URI is not supported by client

Status Open
Reported on v2.1.79
Maintainer reply None cached
Activity 21 comments · opened Mar 19, 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?

When I try to login to my Claude Pro (personal account), I'm unable to authenticate. Tried multiple times. This worked previously. Note: my work API billing account currently still works

What Should Happen?

Claude Pro should successfully authenticate

Error Messages/Logs

Authorization failed Redirect URI https:/platform.claude.com/oauth/code/callback is not supported by client

Steps to Reproduce

  1. claude --settings '{"forceLoginMethod":"claudeai"}' /login
  2. browser popup ([here](https://platform.claude.com/login?selectAccount=true&returnTo=%2Foauth%2Fauthorize%3Fcode%3Dtrue%26client_id%3D9d1c250a-e61b-44d9-88ed-5944d1962f5e%26response_type%3Dcode%26redirect_uri%3Dhttp%253A%252F%252Flocalhost%253A54134%252Fcallback%26scope%3Dorg%253Acreate_api_key%2Buser%253Aprofile%2Buser%253Ainference%2Buser%253Asessions%253Aclaude_code%2Buser%253Amcp_servers%2Buser%253Afile_upload%26code_challenge%3DNfuNMG9YjIqH7wnf_xeF2O77XdkiMtkybotrSvPprH4%26code_challenge_method%3DS256%26state%3D2Jr_CnN1Z2GOCv2v6f8foD6Mu1396zqajzPtc7azqz4))
  3. click Have a Max or Pro Plan? [here](https://claude.ai/oauth/authorize?code=true&client_id=9d1c250a-e61b-44d9-88ed-5944d1962f5e&response_type=code&redirect_uri=http:/localhost:54134/callback&scope=org:create_api_key+user:profile+user:inference+user:sessions:claude_code+user:mcp_servers+user:file_upload&code_challenge=NfuNMG9YjIqH7wnf_xeF2O77XdkiMtkybotrSvPprH4&code_challenge_method=S256&state=2Jr_CnN1Z2GOCv2v6f8foD6Mu1396zqajzPtc7azqz4)Note: same error if manually copying the link
  4. click Authorize
  5. Authorization failed Redirect URI https:/platform.claude.com/oauth/code/callback is not supported by client

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.79 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

19 Comments

github-actions[bot] · 5 months ago

Found 2 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/36015
  2. https://github.com/anthropics/claude-code/issues/34917

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

someoneentirelyelse · 5 months ago

same issue on linux:

Authorization failed

Redirect URI http:/localhost:39217/callback is not supported by client.

AdityaVG13 · 5 months ago

same issue on Windows:

Authorization failed

Redirect URI http:/localhost:56877/callback is not supported by client.

Kattenelvis · 5 months ago

Same issue on linux (nixos):

Redirect URI http:/localhost:43571/callback is not supported by client.

websentinel-agency · 5 months ago

Ici aussi ...

andrejkaseverka · 5 months ago

Same issue now for me on MacOS

mrcz · 5 months ago

I had the same problem, I went to claude.ai and asked Claude about it. I'll include the reply below, but I didn't even need to follow it, the normal signin flow worked afterwards. Maybe I refreshed some token by going to claude.ai.

Claude's reply:

This is a known issue with the Claude Code VS Code extension's OAuth flow. The browser tries to redirect to localhost to complete the login, but if VS Code is running in a remote environment (WSL, SSH, Codespaces, etc.) or the port just isn't reachable, it fails. Here are the best workarounds:
Option 1: Use an API key instead (most reliable)

Go to console.anthropic.com and create an API key.
In the Claude Code extension or terminal, run /login and choose the API key option instead of OAuth.
Paste your key when prompted.

Option 2: Manually extract the auth code from the URL
When the browser redirects to the failing localhost URL, the URL itself contains the auth code — it looks like http://localhost:PORT/callback?code=YOUR_CODE&state=.... GitHub You can copy just the code=... value from that URL and paste it back into the VS Code terminal when prompted.
If the browser doesn't open automatically during login, press c to copy the OAuth URL to your clipboard, paste it into your browser manually, and then copy the code from the resulting URL back into the extension. Claude
Option 3: Set the API key as an environment variable
You can set ANTHROPIC_API_KEY in your environment before launching VS Code, and the extension will pick it up automatically without needing to go through the OAuth flow.
Are you running VS Code remotely? (WSL, SSH, GitHub Codespaces, etc.) — the root cause in remote environments is that the OAuth flow uses a hardcoded localhost redirect URI, which breaks when VS Code and your browser aren't on the same machine. GitHub In that case, the API key approach (Option 1) is the most straightforward fix.

Carlz10 · 5 months ago

Even more straight foward than the above -- manually correcting the syntax in the URI for the callback (i.e. http:/ --> http://) and trying the request again works for those still looking for a way to login successfully.

re: https://github.com/anthropics/claude-code/issues/37831

kenzura-admin · 5 months ago

"Same issue, Mac Mini macOS, Claude Code v2.1.20 and v2.1.76 both affected. 1 year paid subscriber unable to login since day one. Conversation ID: 215473502600074"

manitofigh · 4 months ago

My issue was fixed after noticing and fixing extra spaces in the URL that I copied from the terminal (manually, instead of clicking c).

It is likely many of you have ssh-ed to a remote server and have copied the generated URL and pasted it instead of clicking on it (since you don't want it to open on the remote machine).
In that case, towards the end of each line, an extra space is copied. In my case "oauth" had shifted to "o auth" and thus "o+auth" in the URL that breaks things. You need to find all such cases and manually fix them and paste the corrected URL instead.

Edit: An easier fix is to temporarily minimize the font size of your terminal window/tab so that all the link fits in one line and then copy that. Definitely easier than fixing the breaking points.

totoCZ · 4 months ago

I use warp terminal and yes line break = space. URL not clickable or copiable in terminal. Please rework the login system a bit

manitofigh · 4 months ago

In my case it's iTerm2. I believe it applies to most terminal emulators.

donert · 4 months ago

The “c” to copy didn’t work, even though it said it did. Manual select of the auth request needed to be edited in a text editor to remove the new line characters

sayjeyhi · 3 months ago

In my case since the URL was 3 lines, there an extra space between characters in redirect URL

BobHood · 2 months ago

I was able to get my Claude Code running on my Mac through the terminal window, and then modifying he re-direct adding the http:// in front of the localhost convention.

Once it authenticated in Terminal, I opened iTerm2 and opened claude and it is working without issue...

haok1402 · 2 months ago
In my case since the URL was 3 lines, there an extra space between characters in redirect URL

I had the same issue. Make sure to copy into a text-editor ; verify this...

ETH-Raphael-Bosshart · 1 month ago

What worked for me: I was trying to run Claude Code on a remote server over SSH and kept getting "Authorization failed, Redirect URI not supported" no matter what I tried. The fix was super simple. Just open VS Code, connect to your server with the Remote SSH extension, and run claude in the integrated terminal. When the login link appears you can just cmd click it and it opens right in your browser, sometimes even automatically. VS Code handles all the port forwarding behind the scenes so the OAuth redirect just works.

EdeTede · 1 month ago

Environment. Claude Code v2.1.218 on WSL Ubuntu 24.04. Personal Claude Max
subscription. The account email is on a university domain that enforces single
sign-on.

Problem. Running claude opens the browser sign-in. After signing in while
avoiding the university SSO, the authorization step fails every time with:

Authorization failed
Redirect URI https://platform.claude.com/oauth/code/callback is not supported
by client.

The authorization URL that Claude Code opens uses
redirect_uri=https%3A%2F%2Fplatform.claude.com%2Foauth%2Fcode%2Fcallback and
client_id 9d1c250a-e61b-44d9-88ed-5944d1962f5e.

Steps already tried. Updated to the latest version, removed ~/.claude/cache,
logged out, and retried. The error is identical each time.

Impact. I have a paid Max subscription but cannot log in to Claude Code through
the browser flow at all. This appears related to existing issue 36215.

ETH-Raphael-Bosshart · 1 month ago
Environment. Claude Code v2.1.218 on WSL Ubuntu 24.04. Personal Claude Max subscription. The account email is on a university domain that enforces single sign-on. Problem. Running claude opens the browser sign-in. After signing in while avoiding the university SSO, the authorization step fails every time with: Authorization failed Redirect URI https://platform.claude.com/oauth/code/callback is not supported by client. The authorization URL that Claude Code opens uses redirect_uri=https%3A%2F%2Fplatform.claude.com%2Foauth%2Fcode%2Fcallback and client_id 9d1c250a-e61b-44d9-88ed-5944d1962f5e. Steps already tried. Updated to the latest version, removed ~/.claude/cache, logged out, and retried. The error is identical each time. Impact. I have a paid Max subscription but cannot log in to Claude Code through the browser flow at all. This appears related to existing issue 36215.

You've tried it with VSCode?

Showing cached comments. Read the full discussion on GitHub ↗