[v2] Multi-tenant Entra ID metadata fails the issuer check: issuer is the literal {tenantid} template
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Da chiarire
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- authentication, backend-api-design
Direzione di ricerca
Start with the authorization server metadata discovery and issuer validation code, then read the documentation for skipIssuerMetadataValidation and the related tests. The issue presents several possible outcomes and asks maintainers to decide whether to document the existing escape hatch, improve the error, or add narrower validation behavior. Done means the chosen approach is agreed and implemented with appropriate tests and documentation.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What happened?
OAuth discovery fails against a multi-tenant Microsoft Entra ID authority, so any MCP server whose protected-resource metadata names one (for example https://login.microsoftonline.com/organizations/v2.0) cannot be connected to with the default client settings.
Entra's multi-tenant metadata documents (/organizations/v2.0 and /common/v2.0) return the literal, unsubstituted template as issuer:
GET https://login.microsoftonline.com/organizations/v2.0/.well-known/openid-configuration
"issuer": "https://login.microsoftonline.com/{tenantid}/v2.0"
The SDK's RFC 8414 §3.3 comparison then rejects it:
IssuerMismatchError (kind "metadata"): Issuer mismatch in authorization server metadata (RFC 8414 §3.3):
expected "https://login.microsoftonline.com/organizations/v2.0",
received "https://login.microsoftonline.com/{tenantid}/v2.0"
The check is correct: the document is non-conformant with RFC 8414 §3.3 / OIDC Discovery §4.3, and that is Entra's defect rather than the SDK's. It is still a widely deployed authorization server, and this was reported to the MCP Inspector by a user connecting to a Microsoft Fabric MCP endpoint (modelcontextprotocol/inspector#2983).
The existing escape hatch works — with skipIssuerValidation: true on discovery (or skipIssuerMetadataValidation: true on auth() / the transports) the document is accepted. The Inspector now exposes that as a per-server opt-in, default off (modelcontextprotocol/inspector#3020). The cost is that the opt-out turns the whole issuer comparison off for that server, which is a much broader relaxation than this one known shape needs.
What did you expect?
Raising this for a decision rather than asserting an answer. Options, roughly in order of how much they change:
- Nothing in code; document it. Name multi-tenant Entra in the
skipIssuerMetadataValidationdocs as the known case, so hosts know what the option is for. - Point at the option from the error. Have the metadata-kind
IssuerMismatchErrormessage mentionskipIssuerMetadataValidation, so each host does not have to add its own hint. - A narrower tolerance than the full opt-out. For example an opt-in comparison hook (a caller-supplied predicate over expected/received issuer), or an opt-in that accepts only a received issuer equal to the expected URL with one path segment replaced by the literal
{tenantid}. Either would let a host accept this shape without disabling the mix-up defense for everything else.
Entra's multi-tenant metadata does not advertise authorization_response_iss_parameter_supported, so the RFC 9207 authorization-response check is not involved.
Code to reproduce
import { discoverAuthorizationServerMetadata } from "@modelcontextprotocol/client";
// Throws IssuerMismatchError (kind "metadata")
await discoverAuthorizationServerMetadata(
new URL("https://login.microsoftonline.com/organizations/v2.0"),
);
// Returns the metadata document
await discoverAuthorizationServerMetadata(
new URL("https://login.microsoftonline.com/organizations/v2.0"),
{ skipIssuerValidation: true },
);
SDK version
@modelcontextprotocol/client 2.4.0
Area
Auth
- Lingua principale
- TypeScript
- Stelle
- 13.8k
- Fork
- 2.5k
- Merge medio
- 6g 23h
- PR unite (30g)
- 2
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di modelcontextprotocol/typescript-sdk
-
v2
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
modelcontextprotocol/typescript-sdk#3270 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
`callTool` with `allowInputRequired: true` throws on an `input_required` result when the tool declares an `outputSchema`Forse già presa @mgoldsborough l’ha presa 6 giorni fa. Apertav2
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
modelcontextprotocol/typescript-sdk#3249 ·
I maintainer di solito rispondono entro 1 giorno
-
v2
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
modelcontextprotocol/typescript-sdk#3243 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
TypeScript client accepts an unknown `resultType` in the first `server/discover` replyForse già presa @Tidehyc l’ha presa 7 giorni fa. Apertav2
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
modelcontextprotocol/typescript-sdk#3235 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
UriTemplate.match() throws a TypeError on an empty expression it acceptsForse già presa @yunusemrejs l’ha presa 12 giorni fa. Apertav1 v2
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
modelcontextprotocol/typescript-sdk#3221 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di modelcontextprotocol/typescript-sdk
Issue simili
-
clawsweeper:intake:bug clawsweeper:intake:needs-environment
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
openclaw/openclaw#212827 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
KT-2245 e2e specs that call the backend directly fall back to the developer's own Kronn on :3140Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Use one constant for the 10,000-character input limitForse già presa @NginxL l’ha presa oggi. Apertagood first issue refactor
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
aniru-dh21/snap-validate#51 ·
I maintainer di solito rispondono entro 1 giorno
-
dependencies effort: small good first issue priority: low
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
TMHSDigital/screencast-mcp#509 ·
I maintainer di solito rispondono entro 1 giorno
-
from-review tech-debt testing
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
blamechris/chroxy#9520 ·
I maintainer di solito rispondono entro 1 giorno