Skip to content

fix(client): detect authorization-server migration from fresh PRM#2450

Open
mattzcarey wants to merge 1 commit into
mainfrom
fix/sep-2352-discovery-refresh
Open

fix(client): detect authorization-server migration from fresh PRM#2450
mattzcarey wants to merge 1 commit into
mainfrom
fix/sep-2352-discovery-refresh

Conversation

@mattzcarey

Copy link
Copy Markdown
Contributor

Previously unaddressed

#2358 isolated credentials by issuer once the current authorization server was known, but cached discovery could keep the client pinned to AS-A after a fresh resource_metadata challenge selected AS-B. Existing tests had to clear discovery manually before migration was detected.

This PR

  • re-probes cached discovery only for a fresh resource-metadata challenge
  • compares the newly PRM-validated AS with the recorded identity
  • discards old-AS tokens and non-portable client credentials before continuing
  • preserves portable CIMD client IDs
  • avoids false migration on legacy fallback, transient discovery failure, or the authorization-code callback

Verification

  • client: 735 tests, including migration, fallback, CIMD, and callback cases
  • pnpm check:all
  • pnpm build:all

Follow-up to #2271, #2358, and #2286.

@mattzcarey mattzcarey requested a review from a team as a code owner July 7, 2026 11:11
@changeset-bot

changeset-bot Bot commented Jul 7, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e4de221

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@modelcontextprotocol/client Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Jul 7, 2026

Copy link
Copy Markdown

Open in StackBlitz

@modelcontextprotocol/client

npm i https://pkg.pr.new/@modelcontextprotocol/client@2450

@modelcontextprotocol/codemod

npm i https://pkg.pr.new/@modelcontextprotocol/codemod@2450

@modelcontextprotocol/core

npm i https://pkg.pr.new/@modelcontextprotocol/core@2450

@modelcontextprotocol/server

npm i https://pkg.pr.new/@modelcontextprotocol/server@2450

@modelcontextprotocol/server-legacy

npm i https://pkg.pr.new/@modelcontextprotocol/server-legacy@2450

@modelcontextprotocol/express

npm i https://pkg.pr.new/@modelcontextprotocol/express@2450

@modelcontextprotocol/fastify

npm i https://pkg.pr.new/@modelcontextprotocol/fastify@2450

@modelcontextprotocol/hono

npm i https://pkg.pr.new/@modelcontextprotocol/hono@2450

@modelcontextprotocol/node

npm i https://pkg.pr.new/@modelcontextprotocol/node@2450

commit: e4de221

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant