CIMD declares callback port 33418 but Copilot CLI uses an ephemeral port
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
Copilot CLI’s Client ID Metadata Document declares a fixed loopback callback port, but the CLI sends a different ephemeral port in the OAuth authorization request.
Client metadata: https://github.com/copilot/cli/client-metadata.json
{
"client_id": "https://github.com/copilot/cli/client-metadata.json",
"application_type": "native",
"redirect_uris": [
"http://127.0.0.1:33418/"
]
}
The authorization request generated by Copilot CLI instead contains a callback such as:
redirect_uri=http://127.0.0.1:60005/
My authorization server rejects the request with:
unauthorized_client: Callback URL mismatch.
http://127.0.0.1:60005/ is not in the list of allowed callback URLs
Affected version
GitHub Copilot CLI 1.0.83
Steps to reproduce the behavior
- Configure a remote MCP server protected by an Auth0 authorization server.
- Register Copilot CLI in Auth0 using: https://github.com/copilot/cli/client-metadata.json
- Add the remote MCP server to Copilot CLI.
- Start authentication.
- Inspect the generated /authorize request.
The request uses an ephemeral loopback port rather than the 33418 port declared in the metadata document.
Expected behavior
The redirect URI used by Copilot CLI should be compatible with its published metadata.
Either:
-
Copilot CLI should bind to the declared callback:
http://127.0.0.1:33418/ -
The metadata should declare a portless loopback callback compatible with ephemeral ports:
"redirect_uris": [ "http://127.0.0.1/" ]
There should not be a requirement for every MCP server operator or Copilot user to configure a callback-port override.
Additional context
- Operating system: macOS 26.5.1
- MCP transport: Streamable HTTP
- Authorization server: Auth0
- Client registration: Client ID Metadata Document
For reference, Claude Code also uses an ephemeral loopback but its metadata document declares port-less loopback callbacks:
"redirect_uris": [
"http://localhost/callback",
"http://127.0.0.1/callback"
]
The same Auth0 authorization server accepts Claude Code’s runtime callback while rejecting Copilot CLI’s callback because Copilot’s metadata explicitly pins port 33418.
Claude's metadata: https://claude.ai/oauth/claude-code-client-metadata
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 với client-metadata.json đã được công bố và luồng ủy quyền OAuth của Copilot CLI tạo ra yêu cầu /authorize. So sánh URI chuyển hướng được khai báo với callback loopback khi chạy và xác định hành vi nào cần được đồng bộ; hoàn tất có nghĩa là một authorization server chấp nhận callback mà không cần ghi đè cổng cho từng người dùng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Lĩnh vực
- authentication, cli
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 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
- 58/100