github / github/copilot-cli

Authorization header length limit is too low to accomodate some Entra ID tokens

未关闭
#2,960 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
area:mcp area:networking
主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

描述

### Describe the bug

I'm trying to use the Grafana MCP over an Azure Managed Grafana instance, which authenticates with my Entra account, but it fails upon invoking the MCP commands with the following error:
```
MCP server 'grafana': An error occurred invoking 'amgmcp_datasource_list': Authorization header length 11034 exceeds maximum allowed length of 8192.
```
The issue being that I have a few too many AD Groups (but not enough to trigger the overflow yet), which causes my token to be fairly huge and go past the current 8k limit.
My understanding is that this limit happens on the Copilot side, as this exact setup is working fine in Claude Code.

### Affected version

GitHub Copilot CLI 1.0.35.

### Steps to reproduce the behavior

The MCP is configured as such:
```json
"grafana": {
"type": "http",
"url": "https://.eus.grafana.azure.com/api/azure-mcp",
"headers": {
"Authorization": "Bearer ${GRAFANA_MCP_TOKEN}"
},
"tools": [
"*"
],
},
```

And upon opening Copilot, I'm setting the environment variable like so:
```
export GRAFANA_MCP_TOKEN=$(az account get-access-token --resource "ce34e7e5-485f-4d76-964f-b3d2b16d1e4f" --query accessToken -o tsv)
```
To get an authorization token for the managed grafana resource. The token is indeed around 11kB long.

### Expected behavior

The header length limit should be higher, to accomodate the authorization tokens that might be generated in practice by users, apparently especially users of Entra ID which can get fairly large tokens of ~11-12kB

### Additional context

_No response_

贡献指南

打开贡献指南

调研方向

首先定位 CLI 的 MCP 请求处理中对 8192 字节授权标头的验证,然后使用此处所示的 Grafana 配置和令牌生成命令重现该问题。当大小约为 11–12 kB 的真实 Entra ID 令牌能够在不出现所报告错误的情况下被接受,并且相关限制行为由测试覆盖时,即视为完成。

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

评估

技术栈
azure, shell
领域
authentication, cli
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
52/100

把新 issue 发到你的邮箱

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