Adds support for implicit mTLS (Mutual TLS) transport for client assertion delegates #5670
+478
−51
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.
Fixes #5633
Changes proposed in this request
This pull request introduces support for implicit mTLS (Mutual TLS) transport for client assertion delegates, enhances the handling of mTLS and PoP (Proof of Possession) scenarios, and improves error messaging for regional configuration requirements. The main changes ensure that mTLS is properly requested and validated when using client assertion delegates that can return a TokenBindingCertificate, and that regional endpoints are enforced for mTLS bearer scenarios. Additionally, the codebase is updated to consistently use the new
IsMtlsRequestedproperty for mTLS logic and error handling.mTLS and PoP Handling Improvements
IsMtlsRequestedproperty toAcquireTokenCommonParametersand propagated its usage throughout the codebase for more accurate mTLS detection and handling. [1] [2] [3]Client Assertion Delegate Enhancements
ClientAssertionDelegateCredentialand related builder methods to support aCanReturnTokenBindingCertificateflag, distinguishing between delegates that can provide mTLS certificates and those that cannot. [1] [2] [3] [4] [5]Error Handling and Messaging
MsalError.MtlsBearerWithoutRegion) to clearly indicate when mTLS bearer authentication is attempted without specifying an Azure region, and surfaced this in the public API. [1] [2] [3]mTLS Detection in Discovery and Request Logic
IsMtlsRequestedinstead of checking for certificate presence directly, ensuring mTLS scenarios are consistently recognized in regional endpoint selection and host modification. [1] [2] [3]Token Caching for mTLS PoP
Testing
unit, integration (integration test is skipped for now because ests is not ready)
Performance impact
none
Documentation