docs: MSI v2 mTLS PoP — cross-language design, constraints, and SDK guidance#5936
docs: MSI v2 mTLS PoP — cross-language design, constraints, and SDK guidance#5936gladjohn wants to merge 2 commits into
Conversation
Document the design and constraints of MSI v2 mTLS Proof-of-Possession across different programming languages, including implementation details and challenges.
There was a problem hiding this comment.
Pull request overview
Adds a unified design document for MSI v2 mTLS Proof-of-Possession (PoP) across MSAL languages, capturing platform/key constraints, current language status (.NET delivered, Python POCs), and the shared HTTP transport customization challenge for higher-level SDKs.
Changes:
- Introduces a cross-language overview of X.509/key storage tiers and TLS stack constraints (SChannel vs OpenSSL-like stacks).
- Documents current implementation/POC status for .NET and Python and outlines considerations for Java/Node/Go.
- Describes the .NET
IMsalMtlsHttpClientFactoryapproach and calls out remaining SDK integration gaps.
Add tradeoffs section for mTLS helper in documentation.
| - **Exportable keys (in-memory)** work everywhere — the key bytes can be passed to any TLS stack. | ||
| - **Non-exportable keys (KeyGuard, TPM)** only work with SChannel — which means Windows + a language runtime that uses SChannel. |
There was a problem hiding this comment.
The doc states that exportable/in-memory keys “work everywhere”, but MSAL.NET’s managed identity .WithMtlsProofOfPossession() currently throws on non-Windows platforms. Consider clarifying that MSAL.NET MI mTLS PoP is Windows-only today (even if the in-memory key tier exists), to avoid suggesting a supported cross-platform path in .NET.
| - **Exportable keys (in-memory)** work everywhere — the key bytes can be passed to any TLS stack. | |
| - **Non-exportable keys (KeyGuard, TPM)** only work with SChannel — which means Windows + a language runtime that uses SChannel. | |
| - **Exportable keys (in-memory)** are broadly compatible across platforms at the TLS layer — the key bytes can be passed to any TLS stack. However, that does **not** mean every MSAL SDK currently supports end-to-end managed identity mTLS PoP on every platform. | |
| - **Non-exportable keys (KeyGuard, TPM)** only work with SChannel — which means Windows + a language runtime that uses SChannel. | |
| - **MSAL.NET managed identity caveat** — today, `.WithMtlsProofOfPossession()` is effectively Windows-only for managed identity scenarios. Even though the in-memory/exportable key tier is cross-platform in principle, MSAL.NET currently throws on non-Windows platforms rather than offering a supported cross-platform MI mTLS PoP path. |
| var result = await app.AcquireTokenForManagedIdentity(scope) | ||
| .WithMtlsProofOfPossession() | ||
| .WithAttestationSupport() | ||
| .ExecuteAsync(); |
There was a problem hiding this comment.
The sample chains .WithAttestationSupport(), which lives in the Microsoft.Identity.Client.KeyAttestation package/namespace. Consider adding a short note (or using statement) indicating the extra package dependency so readers can compile the example without guesswork.
Summary
Unified design document covering MSI v2 mTLS PoP across all MSAL languages.
Consolidates findings from .NET (delivered), Python (two POC approaches),
and lays out the open questions for Java, Node, and Go.
What's covered
X.509 certificate and key constraints
Language status
WinHTTP/SChannel ctypes bridge, mtls_http_request() helper
exportable software key, standard requests library, cross-platform
HTTP transport customization for higher-level SDKs
(PR docs: Guidance for SDKs consuming MSAL — HttpClient factory with mTLS PoP #5935)