Skip to content

Conversation

@cpp11nullptr
Copy link

No description provided.

/// This interface is designed to support MTLS scenarios.
/// </remarks>
internal interface IMsalMtlsHttpClientFactory : IMsalHttpClientFactory
public interface IMsalMtlsHttpClientFactory : IMsalHttpClientFactory
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gladjohn - don't we need this to be made public for MSIv2 as well?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we don't need to expose this for MSI v2. We will continue to use the existing factory IMsalHttpClientFactory to make calls into IMDS endpoints, this will ensure we use custom factory. But for the mTLS calls to ESTS, we will use the new IMsalMtlsHttpClientFactory. MSAL will be responsible for calls to ESTS.

/// .NET should use SocketHandler, but UseDefaultCredentials doesn't work with it
/// </remarks>
internal class SimpleHttpClientFactory : IMsalMtlsHttpClientFactory, IMsalSFHttpClientFactory
public class SecureHttpClientFactory : IMsalMtlsHttpClientFactory, IMsalSFHttpClientFactory
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you make this public?

Copy link
Author

@cpp11nullptr cpp11nullptr Oct 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly to reuse the logic to create HTTP client with setting up a certificate by Identity.Web but it can be also beneficial for users of MSAL.NET who wants either secure HTTP client factory (with mTLS or server certificate validation).

@cpp11nullptr cpp11nullptr changed the title [POC] Expose secure HTTP client factory [POC] Expose secure HTTP client factory and propagate binding certificate in authentication result Oct 22, 2025
/// <summary>
/// Internal factory responsible for creating HttpClient instances configured for mutual TLS (MTLS).
/// This factory is specifically intended for use within the MSAL library for secure communication with Azure AD using MTLS.
/// A factory responsible for creating HttpClient instances configured for mutual TLS (MTLS).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it an interface not an actual factory?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants