Skip to content

[BUG] OAuth login fails - "Missing code_challenge" / Invalid OAuth Request on Max subscription #45340

Description

@prezis

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?

OAuth login fails with "Invalid OAuth Request - Missing code_challenge parameter"
when using /login with Max subscription on Ubuntu Linux.

The URL generated by Claude Code contains invalid parameters that cause
claude.com to reject the request.

Workaround: manually edit the OAuth URL before opening in browser:

  1. Remove "code=true&" from the beginning of query params
  2. Remove "org%3Acreate_api_key+" from the scope parameter

This works correctly after editing.

What Should Happen?

Browser opens the OAuth authorization page, user logs in,
receives a code to paste back into the terminal, and Claude Code
authenticates successfully with the Max subscription.

Error Messages/Logs

Invalid OAuth Request - Missing code_challenge parameter

Steps to Reproduce

  1. Run /login in Claude Code
  2. Press "c" to copy the OAuth URL
  3. Paste URL in browser without modification
  4. Browser shows "Invalid OAuth Request - Missing code_challenge parameter"

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

Claude Code 2.1.96.

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions