Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Passing ACR_VALUES TO Token Endpoint

未关闭
#720 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
45/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
csharp

调研方向

从 ClientOAuthProvider 开始,重点查看 ExchangeCodeForTokenAsync 以及 BuildAuthorizationUrl 中现有的 _additionalAuthorizationParameters 处理方式。跟踪 token 请求和 refresh 请求的构造方式,然后检查周围是否存在相关测试。完成标准是:支持请求的附加参数用于 token 交换和 refresh,同时保留 RFC 6749 中描述的 endpoint 行为。

由索引模型根据 Issue 内容生成。

描述

enhancement needs confirmation

The ClientOAuthProvider can manage acr requests to the authorize endpoint via the _additionalAuthorizationParameters but the token endpoint does not support additional parameters.

internal sealed partial class ClientOAuthProvider
{
    private readonly IDictionary<string, string> _additionalAuthorizationParameters;
}
...
 private Uri BuildAuthorizationUrl(
     ProtectedResourceMetadata protectedResourceMetadata,
     AuthorizationServerMetadata authServerMetadata,
     string codeChallenge)
{
...
foreach (var kvp in _additionalAuthorizationParameters)
{
    queryParamsDictionary.Add(kvp.Key, kvp.Value);
}

var queryParams = HttpUtility.ParseQueryString(string.Empty);
foreach (var kvp in queryParamsDictionary)
{
    queryParams[kvp.Key] = kvp.Value;
}

var uriBuilder = new UriBuilder(authServerMetadata.AuthorizationEndpoint)
{
    Query = queryParams.ToString()
};


BUT IN only the token endpoint is used. No additional params are passed. This is needed for multitenancy support.

 private async Task<TokenContainer> ExchangeCodeForTokenAsync(
     ProtectedResourceMetadata protectedResourceMetadata,
     AuthorizationServerMetadata authServerMetadata,
     string authorizationCode,
     string codeVerifier,
     CancellationToken cancellationToken)
....
 using var request = new HttpRequestMessage(HttpMethod.Post, authServerMetadata.TokenEndpoint)
 {
     Content = requestContent
 };

Please see https://www.rfc-editor.org/rfc/rfc6749#section-3.2 for Token Endpoint Spec as it is supported and part of spec.

The endpoint URI MAY include an "application/x-www-form-urlencoded"
formatted (per Appendix B) query component ([RFC3986] Section 3.4),
which MUST be retained when adding additional query parameters. The
endpoint URI MUST NOT include a fragment component.

Can this please be added to ClientOAUthProvider for ExchangeToken and Refresh Token please

主要语言
C#
星标
4.6k
派生
819
平均合并
8 天 7 小时
30 天内合并 PR
3

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

modelcontextprotocol/csharp-sdk 的其他 Issue

查看 modelcontextprotocol/csharp-sdk 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。