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
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Shell
- Star
- 11.2k
- Fork
- 1.9k
- Merge trung bình
- 14 giờ 16 phút
- Pull request đã merge (30 ngày)
- 6
Mô tả
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
- 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.
-
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.
-
macOS 1.1.17 works. That build contains no OneAuth strings at all, so the variable is never consumed.
Steps to reproduce
- Windows machine with
COPILOT_ENTRA_AUTH_AUDset machine-wide (any EMU-configured device). - Add an Entra-protected MCP server whose API lives in a different tenant.
- Sign in from the MCP tab. Fails 100%.
- 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.
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng cách so sánh CLI runtime được đóng gói của ứng dụng desktop trong resources/copilot-sdk/cliVersion.d.ts với hành vi của CLI @github/copilot đang hoạt động trên Windows. Tái hiện việc đăng nhập MCP khi COPILOT_ENTRA_AUTH_AUD được đặt, sau đó khi biến này bị xóa và khi COPILOT_ENTRA_DISABLE_ONEAUTH=1. Hoàn tất khi việc đăng nhập MCP bỏ qua audience của Copilot và chuyển sang trình duyệt sau một lần từ chối ENTRA_CONFIG.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- github
- Lĩnh vực
- authentication, cli, desktop-dev
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Sôi nổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 48/100