github / github/app

[Bug] macOS Keychain repeated and frequent prompts to allow access

Đang mở
#2,224 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Bugs
Ngôn ngữ chính
Không có dữ liệu ngôn ngữ
Star
2.1k
Fork
153
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

macOS Keychain prompts constantly for `copilot-mcp-oauth` — a new keychain item is created on every token refresh, and "Always Allow" never persists.

**Affected version:** v1.0.25

## Summary
On macOS, the GitHub app repeatedly triggers a system Keychain password prompt for the keychain service `copilot-mcp-oauth`. Clicking **Always Allow** does not stop it — I'm asked for my macOS login password many times a day to unlock Keychain for the GitHub App.

## Environment
- GitHub app version: 1.0.25 (latest installed)
- OS: macOS 26.5.2 Tahoe
- Keychain service affected: `copilot-mcp-oauth`
- Related MCP integration: Power BI (token scope `https://analysis.windows.net/powerbi/api/user_impersonation`)

## What I observed
- The `copilot-mcp-oauth` keychain contains a large number of separate entries — **63 for today alone**.
- Each entry stores a short-lived OAuth token, e.g.:
`{"accessToken":"","expiresAt":1784716427,"scope":"/powerbi/api/user_impersonation"}`
- A new entry appears to be created on **every token refresh** rather than updating a single existing entry.

## Actual behavior
A new keychain item is created on each refresh. Because macOS "Always Allow" trust is granted **per item**, it never applies to the newly created items — producing constant password prompts and dozens of stale entries per day.

## Possible cause (two mechanisms likely compounding)
1. **Per-refresh item creation** — the token cache writes a new keychain item instead of overwriting one, so previously granted access never applies.
2. **Unstable ACL / code-signing identity** — if the accessing helper process isn't stably code-signed, macOS treats each access as a new requester and re-prompts even for an existing item. This is the classic reason "Always Allow" fails to persist.

## Impact
Password fatigue plus dozens of stale OAuth entries accumulating in the login keychain every day. Disruptive to normal workflow.

## Steps to reproduce
1. Use the GitHub app on macOS with the Power BI MCP integration authenticated.
2. Continue normal use so the OAuth access token refreshes (tokens are short-lived).
3. Observe a macOS Keychain access prompt for `copilot-mcp-oauth`.
4. Click **Always Allow**.
5. On the next token refresh, the prompt reappears.
6. Open **Keychain Access** and search `copilot-mcp-oauth` — note the growing count of distinct entries.

## Expected behavior
Tokens for a given MCP integration are stored in (and updated within) a **single** keychain item, so granting **Always Allow** once persists and no further prompts appear.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Trace the macOS Keychain access path for `copilot-mcp-oauth`, starting with the token-cache refresh/write logic and the MCP OAuth integration. Verify whether refreshes create distinct items and inspect the helper's signing identity and ACL behavior. Done means one item per integration is updated in place and “Always Allow” persists without repeated prompts, with regression coverage if relevant tests exist.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
macos
Lĩnh vực
authentication, desktop, security
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.