Skip to content

OAuth: Client not following RFC 9728 discovery flow, constructs incorrect authorization URLs #3911

@austinlparker

Description

@austinlparker

Before opening, please confirm:

Operating System

macOS

Kiro Version

Kiro CLI (latest)

Bug Description

Kiro is not properly implementing OAuth 2.0 Protected Resource discovery (RFC 9728) when connecting to MCP servers with OAuth authentication. Instead of following the discovery flow to find the authorization server and endpoints, Kiro hardcodes assumptions about the URL structure.

What Kiro is doing (incorrect):

  1. Takes the MCP server URL (e.g., https://mcp.honeycomb.io)
  2. Appends /authorize to create: https://mcp.honeycomb.io/authorize
  3. Opens this URL in the browser → 404 error

What Kiro should do (per RFC 9728):

  1. Fetch https://mcp.honeycomb.io/.well-known/oauth-protected-resource
  2. Extract authorization_servers[0]https://ui.honeycomb.io
  3. Fetch https://ui.honeycomb.io/.well-known/oauth-authorization-server
  4. Extract authorization_endpointhttps://ui.honeycomb.io/oauth/authorize
  5. Open the correct authorization URL

Steps to Reproduce

  1. Configure Honeycomb's MCP server in ~/.kiro/settings/mcp.json:
{
  "mcpServers": {
    "honeycomb": {
      "url": "https://mcp.honeycomb.io",
      "type": "http"
    }
  }
}
  1. Attempt to connect to the Honeycomb MCP server in Kiro
  2. When prompted to authenticate, click "Open" to authorize
  3. Browser opens to: https://mcp.honeycomb.io/authorize?...404 Not Found

Expected Behavior

Browser should open to the correct authorization endpoint discovered via OAuth metadata:

https://ui.honeycomb.io/oauth/authorize?response_type=code&client_id=...

Server Metadata (Verified Correct)

Protected Resource Metadata (https://mcp.honeycomb.io/.well-known/oauth-protected-resource):

{
  "resource": "https://mcp.honeycomb.io/mcp",
  "authorization_servers": ["https://ui.honeycomb.io"],
  "scopes_supported": ["mcp:read", "mcp:write"],
  "bearer_methods_supported": ["header"]
}

Authorization Server Metadata (https://ui.honeycomb.io/.well-known/oauth-authorization-server):

{
  "issuer": "https://ui.honeycomb.io",
  "authorization_endpoint": "https://ui.honeycomb.io/oauth/authorize",
  "token_endpoint": "https://ui.honeycomb.io/oauth/token",
  "registration_endpoint": "https://ui.honeycomb.io/oauth/register",
  ...
}

Root Cause

Kiro appears to be hardcoding the authorization URL construction instead of implementing the OAuth 2.0 discovery flow. This breaks when:

  • The authorization server is on a different domain than the MCP server
  • The authorization endpoint is not at /authorize (e.g., /oauth/authorize)

Conversation ID

No response

Additional Context

References:

Related Issues:

This bug affects any MCP server that:

  • Hosts the authorization server on a different domain than the resource server
  • Uses a non-standard authorization endpoint path

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions