github / github/copilot-cli

Desktop app 1.1.17:  COPILOT_ENTRA_AUTH_AUD  (EMU audience) breaks MCP Entra sign-in with  ENTRA_CONFIG 2002 - CLI on the same machine works

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

还没有人认领这个 Issue。

triage
主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

描述

Describe the bug

Environment

Item Detail
Failing GitHub Copilot desktop app 1.1.17, Windows
Bundled CLI runtime 1.0.83 (resources/copilot-sdk/cliVersion.d.ts)
Machine Windows 11, Entra-joined, GitHub EMU configured
Working @github/copilot CLI on the same machine, same variable set
Working Desktop app 1.1.17 on macOS, that build contains no OneAuth code path
Related #4660 (WAM landed in 1.0.81; fallback fix in 1.0.82, present in 1.0.83 and still failing)
The bug

Windows devices configured for GitHub Enterprise Managed Users carry a machine-scope variable:

COPILOT_ENTRA_AUTH_AUD = "some-value"
                     = "GitHub Enterprise Managed User (OIDC)"  (GitHub's tenant)

It exists for Copilot's own Entra to GitHub token exchange. Since the WAM/OneAuth MCP path landed (#4660), it also reaches MCP sign-in, pinning a cross-tenant audience while the authority is the customer's own tenant. OneAuth rejects the configuration before any network call:

Request session.mcp.oauth.login failed: Microsoft Entra sign-in for
https://<our-mcp-server>/mcp/ failed: ENTRA_CONFIG: the authenticator
rejected the configuration [code 2002, tag 7q6cl].
Set COPILOT_ENTRA_DISABLE_ONEAUTH=1 to sign in through the browser instead.
Three observations that isolate it to the OneAuth path
  1. Clearing the variable for a single process fixes it, with no client or server change:
Remove-Item Env:\COPILOT_ENTRA_AUTH_AUD
Start-Process "$env:LOCALAPPDATA\Programs\GitHub Copilot\github.exe"

Sign-in then succeeds immediately.

  1. The CLI works on the same machine with the machine-scope variable still set, consistent with the release note that machines without the broker library keep the browser flow.

  2. macOS 1.1.17 works. That build contains no OneAuth strings at all, so the variable is never consumed.

Steps to reproduce
  1. Windows machine with COPILOT_ENTRA_AUTH_AUD set machine-wide (any EMU-configured device).
  2. Add an Entra-protected MCP server whose API lives in a different tenant.
  3. Sign in from the MCP tab. Fails 100%.
  4. Same server, same machine, via the CLI. Succeeds.
Expected behavior

MCP token acquisition ignores COPILOT_ENTRA_AUTH_AUD, and an ENTRA_CONFIG rejection falls back to the browser flow rather than failing hard.

贡献指南

打开贡献指南

从这里开始

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

调研方向

首先,将桌面应用在 resources/copilot-sdk/cliVersion.d.ts 中捆绑的 CLI runtime 与 Windows 上正常工作的 @github/copilot CLI 行为进行比较。在设置 COPILOT_ENTRA_AUTH_AUD 的情况下复现 MCP 登录,然后移除该变量,再使用 COPILOT_ENTRA_DISABLE_ONEAUTH=1 进行复现。当 MCP 登录忽略 Copilot audience,并在 ENTRA_CONFIG 拒绝后回退到浏览器时,即表示完成。

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

评估

技术栈
github
领域
authentication, cli, desktop-dev
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
活跃
描述清晰度
基本清楚
新手友好度
48/100

把新 issue 发到你的邮箱

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