Skip to content

[BUG] MCP oAuth2.1 Dynamic client registration fails #20990

@struckoff

Description

@struckoff

What happened?

OAuth dynamic client registration fails: registrationUrl dropped in WWW-Authenticate discovery path

What did you expect to happen?

When connecting to an MCP server that advertises registration_endpoint in its OAuth Authorization Server Metadata (RFC 8414), gemini-cli should successfully discover and use that endpoint for
dynamic client registration (RFC 7591) without requiring manual configuration.

Specifically, after the WWW-Authenticate discovery path succeeds (discoverOAuthFromWWWAuthenticate returns a config with registrationUrl), the registrationUrl should be preserved through the entire
flow and used for registerClient().

Client information

Client Information

Run gemini to enter the interactive CLI, then run the /about command.

> /about
About Gemini CLI                                                                                                                                                                                                                                                                                  │
│                                                                                                                                                                                                                                                                                                   │
│ CLI Version                                                                                          0.29.7                                                                                                                                                                                       │
│ Git Commit                                                                                           118984025f                                                                                                                                                                                   │
│ Model                                                                                                Auto (Gemini 3)                                                                                                                                                                              │
│ Sandbox                                                                                              no sandbox                                                                                                                                                                                   │
│ OS                                                                                                   linux                                                                                                                                                                                        │
│ Auth Method                                                                                          Logged in with Google (as5423.ru@gmail.com)                                                                                                                                                  │
│ Tier                                                                                                 Gemini Code Assist for individuals                                                                                

Login information

No response

Anything else we need to know?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/securityIssues related to securityeffort/medium2-3 days: UI state, async flow, cross-component refactorskind/bugpriority/p2Important but can be addressed in a future release.status/bot-triaged

    Type

    No fields configured for Bug.

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions