Skip to content

entra: show request origin in interactive sign-in prompts - #2495

Open
cveld wants to merge 1 commit into
git-ecosystem:mainfrom
cveld:feat/prompt-origin-context
Open

cveld wants to merge 1 commit into
git-ecosystem:mainfrom
cveld:feat/prompt-origin-context

Conversation

@cveld

@cveld cveld commented Nov 3, 2026

Copy link
Copy Markdown

Part of #2463.

When several repositories (or worktrees) need a sign-in at the same time, the
prompts give no hint which request they belong to, so it is easy to dismiss or
accept one blindly.

This adds an ambient AuthPromptContext that the Azure Repos provider sets to
host/path before it asks Entra for a token. It is then shown in:

  • the default-account prompt, in both the GUI view (For: <remote>) and the
    console prompt (Continue with current account (x) for <remote>?);
  • the stub ProgressWindow that parents the Windows broker sign-in, which now
    also shows the working directory of the Git process that requested the
    credential (Requested from: <cwd>).

The context is an AsyncLocal, so concurrent requests in one process do not see
each other's value. If no context is set (any other provider), the prompts look
exactly as before; the progress window then only shows the working directory.

Scope

  • Azure Repos / Entra only. GitHub and other providers' prompts are unchanged.
  • It does not show the calling process (the "grandparent") that Can more context be provided in the pop up #2463 also asks
    for. The working directory is the closest available signal. Showing the process
    chain would need per-platform work and could be a follow-up.
  • Because of this the PR says "Part of" and not "Closes".

Testing

  • Added AuthPromptContextTests (flow into awaited work, isolation between
    concurrent flows, the progress window text with and without a request,
    DefaultAccountViewModel.HasContext).
  • Ran the full solution test suite on Windows (dotnet test git-credential-manager.slnx,
    with DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1 because the six
    Trace2MessageTests.BuildTimeSpan cases fail under a decimal-comma culture on my machine):
    all projects pass.
  • Rendered the real ProgressWindow and DefaultAccountView with sample data
    (short and very long remotes and paths) to check that the text wraps and the
    windows grow as expected.
  • Not yet verified: macOS and Linux (the GUI view and console prompt changes are
    platform-neutral, but I only ran Windows), and the progress window during a real
    broker sign-in through git-credential-manager.exe.

🤖 Generated with Claude Code

When several repositories trigger an Entra sign-in at once it is hard to
tell which request a prompt belongs to. Capture the remote (host/path)
in an ambient AuthPromptContext and show it in the default-account
prompt (GUI and console). The stub ProgressWindow that parents the
broker sign-in now also shows the remote and the working directory of
the requesting Git process.

Only the Azure Repos provider sets the context for now; other providers
are unchanged.

Assisted-by: Claude Sonnet 5.5
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@cveld
cveld requested a review from a team as a code owner November 3, 2026 21:28

This branch has not been deployed

No deployments
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.

1 participant