Test + doc: x-ms-tokenboundauth header for AKV mTLS PoP via ExtraHeaderParameters - #3864
Merged
Gladwin Johnson VR (gladjohn) merged 1 commit intoJun 17, 2026
Conversation
Bogdan Gavril (bgavrilMS)
requested changes
Jun 17, 2026
Gladwin Johnson VR (gladjohn)
force-pushed
the
gladjohn/msi-mtls-akv-tokenboundauth-header
branch
from
June 17, 2026 13:35
68fa462 to
dc25a93
Compare
Gladwin Johnson VR (gladjohn)
force-pushed
the
gladjohn/msi-mtls-akv-tokenboundauth-header
branch
from
June 17, 2026 13:37
dc25a93 to
2d8733d
Compare
…ters Azure Key Vault requires 'x-ms-tokenboundauth: true' on mTLS PoP requests to trigger TLS renegotiation for client cert binding. Without it, AKV returns 401. Instead of hardcoding vault host detection in a DelegatingHandler, this uses IdWeb's existing ExtraHeaderParameters config surface — letting developers declare the header per-service in appsettings.json. Changes: - Add 16 unit tests proving ExtraHeaderParameters correctly applies the header for MSI (user-assigned + system-assigned), FIC, and sovereign cloud scenarios - Update daemon-app-msi-mtls sample with ExtraHeaderParameters config - Document the AKV requirement in Program.cs header comment Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Gladwin Johnson VR (gladjohn)
force-pushed
the
gladjohn/msi-mtls-akv-tokenboundauth-header
branch
from
June 17, 2026 13:38
2d8733d to
e393115
Compare
Bogdan Gavril (bgavrilMS)
approved these changes
Jun 17, 2026
Gladwin Johnson VR (gladjohn)
deleted the
gladjohn/msi-mtls-akv-tokenboundauth-header
branch
June 17, 2026 13:52
This was referenced Jun 24, 2026
Merged
Closed
Closed
Closed
This was referenced Jul 20, 2026
Closed
This was referenced Jul 27, 2026
Closed
Closed
Closed
Closed
Closed
Closed
Closed
Merged
Merged
Open
Closed
This was referenced Aug 3, 2026
Closed
This was referenced Aug 12, 2026
This was referenced Aug 19, 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.
Summary
Azure Key Vault requires
x-ms-tokenboundauth: trueon mTLS PoP requests to trigger TLS renegotiation for client certificate binding. Without it, AKV returns 401: Client certificate required for using MTLS_POP token.This PR validates and documents that IdWeb's existing
ExtraHeaderParametersconfig surface handles this correctly — no production code changes needed.Changes
CustomizeHttpRequestMessagedynamic approachdaemon-app-msi-mtlssample withExtraHeaderParametersinappsettings.jsonProgram.csheader commentDeveloper configuration
{ "AzureKeyVault": { "BaseUrl": "https://myvault.vault.azure.net/", "RequestAppToken": true, "ProtocolScheme": "MTLS_POP", "Scopes": ["https://vault.azure.net/.default"], "AcquireTokenOptions": { "ManagedIdentity": { "UserAssignedClientId": "<your-client-id>" } }, "ExtraHeaderParameters": { "x-ms-tokenboundauth": "true" } } }Why not a DelegatingHandler?
Per reviewer feedback: hardcoding vault host strings is brittle.
ExtraHeaderParametersis the IdWeb-native extensibility point — it's declarative, JSON-configurable, and lets each developer control which services get the header.