Share via


IMsalSFHttpClientFactory Interface

Definition

Factory responsible for creating HttpClient with a custom server certificate validation callback. This is useful for the Service Fabric scenario where the server certificate validation is required using the server cert. See https://learn.microsoft.com/dotnet/api/system.net.http.httpclient?view=net-7.0#instancing for more details.

public interface IMsalSFHttpClientFactory : Microsoft.Identity.Client.IMsalHttpClientFactory
type IMsalSFHttpClientFactory = interface
    interface IMsalHttpClientFactory
Public Interface IMsalSFHttpClientFactory
Implements IMsalHttpClientFactory
Implements

Remarks

Implementations must be thread safe. Do not create a new HttpClient for each call to GetHttpClient(Func<HttpRequestMessage,X509Certificate2,X509Chain,SslPolicyErrors,Boolean>) - this leads to socket exhaustion. If your app uses Integrated Windows Authentication, ensure UseDefaultCredentials is set to true.

Methods

GetHttpClient()

Method returning an HTTP client that will be used to communicate with Azure AD. This enables advanced scenarios. See https://aka.ms/msal-net-application-configuration.

(Inherited from IMsalHttpClientFactory)
GetHttpClient(Func<HttpRequestMessage,X509Certificate2,X509Chain,SslPolicyErrors,Boolean>)

Method returning an HTTP client that will be used to validate the server certificate through the provided callback. This method is useful when custom certificate validation logic is required, for the managed identity flow running on a service fabric cluster.

Applies to