Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Scopes not forwarded to DCR endpoint and duplication of RedirectUris

Aperta
#887 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
csharp

Direzione di ricerca

Inizia con HttpClientTransport e la gestione di OAuth e DynamicClientRegistrationOptions, quindi segui il percorso con cui ResourceMetadata.ScopesSupported raggiunge la richiesta DCR. Verifica che gli scopes richiesti vengano inoltrati e determina come debbano essere riconciliati i valori RedirectUri di OAuth e DCR; il lavoro è completo quando entrambi i comportamenti sono coperti senza richiedere una configurazione duplicata.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area-auth bug needs confirmation P2

I have implemented an MCP server and added DCR support to my Duende Identity Server, and it all kind of works with the MCP Server and MCP Client in the SDK. However, one issue seems to be with scopes. The server declares it's supported scopes:

.AddMcp(options =>
{
    options.ResourceMetadata = new()
    {
        Resource = new Uri(serverUrl),
        AuthorizationServers = { new Uri(chronosIdp) },       
        ScopesSupported = ["mcp:tools"]
    };
});

However, in the request that my DCR endpoint receives, Scopes is null. Shouldn't the HttpClientTransport take the scopes from the MCP Server and add these to the DCR request?

Right now I can add them manually here, but a normal MCP tool user wouldn't know what scopes to request - that's why the MCP server declares them:

var transport = new HttpClientTransport(new()
{
    Endpoint = new Uri(serverUrl),
    Name = "Secure Chronos Client",
    OAuth = new()
    {
        Scopes = [ "mcp:tools", "chronosapi"], // shouldn't need to do this!
        RedirectUri = new Uri("http://localhost:1179/callback"),
        AuthorizationRedirectDelegate = HandleAuthorizationUrlAsync,
        DynamicClientRegistration = new DynamicClientRegistrationOptions
        {
            ClientName = "Chronos MCP Client",
            ClientUri = new Uri("http://localhost:1179/callback")            
        },
    }
}, httpClient, consoleLoggerFactory);

var client = await McpClient.CreateAsync(transport, loggerFactory: consoleLoggerFactory);

Also it seems a bit redundant to specify the same RedirectUri in the OAuth object AND the DCR object - they are necessarily the same so maybe if the DCR property is present the OAuth object can use the info there - or vice versa. Just to make it easier to set up correctly.

Lingua principale
C#
Stelle
4.5k
Fork
814
Merge medio
9g 19h
PR unite (30g)
4

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di modelcontextprotocol/csharp-sdk

Tutte le issue di modelcontextprotocol/csharp-sdk

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.