Support forwarding MSAL client metadata headers through IMDS to ESTS#5912
Draft
Support forwarding MSAL client metadata headers through IMDS to ESTS#5912
Conversation
…anaged identity requests Agent-Logs-Url: https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/sessions/3838f1da-3e5a-4e58-a5bc-6023d18f0c18 Co-authored-by: neha-bhargava <61847233+neha-bhargava@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Support forwarding MSAL client metadata headers through IMDS to ESTS
Support forwarding MSAL client metadata headers through IMDS to ESTS
Apr 7, 2026
gladjohn
approved these changes
Apr 8, 2026
Contributor
gladjohn
left a comment
There was a problem hiding this comment.
looks good @neha-bhargava
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.
IMDSv1 managed identity token requests only sent
Metadata: true— IMDS couldn't forward client metadata to ESTS because the headers were never sent.Changes
ImdsManagedIdentitySource.CreateRequestAsync()— Adds three client metadata headers to every IMDSv1 token request:x-client-SKU→ platform product name viaPlatformProxy.GetProductName()x-client-Ver→ MSAL assembly version viaMsalIdHelper.GetMsalVersion()client-request-id→ correlation GUID from_requestContext.CorrelationIdMockHttpManagerExtensions(IMDS case) — AddsPresentRequestHeadersfor the three new headers, so all existing IMDS mock-based tests now implicitly validate their presence.ImdsTests— New testImds_ClientMetadataHeaders_AreSentWithRequest_Asyncexplicitly asserts header presence and correct values (SKU/Ver matched againstMsalIdHelper, correlation ID validated as a GUID).No changes to IMDSv2, CloudShell, AppService, or any other managed identity source.
Testing
Unit tests added in
ImdsTests.cs. All 14 existing IMDS tests and 160ManagedIdentityTestspass.Performance impact
Negligible — three additional string assignments per IMDSv1 request.
Documentation