Handle Browser Credential Failure in Chained Credential.#2076
Merged
g2vinay merged 2 commits intomicrosoft:mainfrom Mar 17, 2026
Merged
Handle Browser Credential Failure in Chained Credential.#2076g2vinay merged 2 commits intomicrosoft:mainfrom
g2vinay merged 2 commits intomicrosoft:mainfrom
Conversation
Two issues affecting Docker users:
1. The azmcp binary in /mcp-server/ lacked execute permission because only
the renamed server-binary was chmod'd. Any direct invocation of ./azmcp
(custom entrypoints, workaround configs) hit 'permission denied'.
Fix: chmod both server-binary and \.
2. InteractiveBrowserCredential's MSAL token-cache persistence requires
libsecret, which was absent from the Alpine base image. This caused
'Persistence check failed / libsecret-1.so.0 not found' errors even
when valid service-principal credentials were supplied via env vars,
because the MsalCachePersistenceException propagated as an unhandled
exception rather than CredentialUnavailableException, killing the chain.
Fixes:
- Install libsecret in the Dockerfile so persistence works when a
keyring daemon is available.
- Wrap CreateBrowserCredential in SafeTokenCredential so any remaining
persistence failure gracefully falls through the credential chain
instead of surfacing as an unhandled AuthenticationFailedException.
Adds a Docker section to docs/Authentication.md explaining that
AZURE_TOKEN_CREDENTIALS=prod must be set when running in a container to
avoid interactive-credential fallback and the libsecret dependency.
Contributor
There was a problem hiding this comment.
Pull request overview
Updates Azure MCP’s authentication flow to avoid hard failures when the InteractiveBrowserCredential fallback can’t initialize (common in headless/Docker environments), and records the fix in the server changelog.
Changes:
- Wrap the InteractiveBrowserCredential fallback in
SafeTokenCredentialso non-CredentialUnavailableExceptionfailures don’t prematurely terminate the chained credential flow. - Add a changelog entry noting the fix for InteractiveBrowserCredential-related crashes.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| servers/Azure.Mcp.Server/changelog-entries/1773705083200.yaml | Documents the bug fix in the server changelog entry format. |
| core/Microsoft.Mcp.Core/src/Services/Azure/Authentication/CustomChainedCredential.cs | Ensures the browser fallback credential failures are normalized for proper chaining behavior. |
anannya03
approved these changes
Mar 17, 2026
colbytimm
pushed a commit
to colbytimm/microsoft-mcp
that referenced
this pull request
Apr 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.