Test + doc: x-ms-tokenboundauth header for AKV mTLS PoP via ExtraHeaderParameters#3864
Merged
Merged
Conversation
bgavrilMS
reviewed
Jun 16, 2026
bgavrilMS
requested changes
Jun 17, 2026
68fa462 to
dc25a93
Compare
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>
2d8733d to
e393115
Compare
bgavrilMS
approved these changes
Jun 17, 2026
This was referenced Jun 24, 2026
Merged
Closed
Open
Open
This was referenced Jun 24, 2026
Merged
Merged
Closed
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.