IHttpClient Interface
public interface IHttpClient
Interface to be implemented when configuring a custom HTTP client for IPublicClientApplication or IConfidentialClientApplication.
MSAL Java uses HTTP to communicate with the Microsoft identity platform for authentication and token acquisition. By default, MSAL uses the JDK's HttpURLConnection, but this interface allows applications to provide their own HTTP client implementation. This is useful when:
- Applications need to customize network behavior (e.g., configure proxies, add custom headers)
- Applications want to use a specific HTTP client library like Apache HttpClient or OkHttp
- Applications need to integrate with existing network infrastructure or logging systems
For more details, see https://aka.ms/msal4j-http-client
Method Summary
| Modifier and Type | Method and Description |
|---|---|
|
abstract
IHttp |
send(HttpRequest httpRequest)
Executes an outgoing HTTP request using the HTTP client implementation of choice. |
Method Details
send
public abstract IHttpResponse send(HttpRequest httpRequest)
Executes an outgoing HTTP request using the HTTP client implementation of choice.
This method should handle all the details of making the HTTP request and adapting the response to the IHttpResponse interface. The implementation should also include appropriate error handling for network-related issues.
Parameters:
Returns:
Throws: