Skip to content

msauth: isolate macOS user token cache - #2413

Open
thomasaarholt wants to merge 1 commit into
git-ecosystem:mainfrom
thomasaarholt:fix/2079-macos-keychain-cache
Open

msauth: isolate macOS user token cache#2413
thomasaarholt wants to merge 1 commit into
git-ecosystem:mainfrom
thomasaarholt:fix/2079-macos-keychain-cache

Conversation

@thomasaarholt

Copy link
Copy Markdown

The problem

On macOS, GCM shares the Microsoft.Developer.IdentityService MSAL Keychain item with other Microsoft developer tools. When another tool recreates this item, its access-control list can lose GCM's entry, causing repeated Keychain password prompts even after selecting Always Allow.

The solution

Use a GCM-owned Keychain item and cache file for the macOS user-token cache. This prevents other applications from changing GCM's Keychain permissions while retaining persistent authentication between GCM processes.

Windows and Linux continue using the shared Microsoft developer cache. macOS users may need to authenticate once after upgrading to populate the new cache.

Fixes #2079.

Testing

  • dotnet test src/shared/Core.Tests/Core.Tests.csproj --no-restore --nologo
  • dotnet build -c MacDebug --no-restore --nologo
  • Installed the generated arm64 package and verified the installed binary version and checksum.

Use a GCM-owned Keychain item on macOS so other Microsoft developer tools cannot replace the shared cache item and discard GCM's access control entry. Preserve shared cache behavior on Windows and Linux.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Constantly being asked to authenticate keychain on MacOS against Azure Devops

1 participant