-
Notifications
You must be signed in to change notification settings - Fork 214
Providing an HttpClient
Starting in Adal 5.0.1-preview (not yet released) you will be able to provide your own Httpclient to enable fine grained control on the Http proxy. ASP.NET has efficient ways of pooling the HttpClient instance. For details see Use HttpClientFactory to implement resilient Http requests.
A new interface IHttpClientFactory
to pass-in the HttpClient will be used by ADAL.NET to communicate with the endpoints of the Microsoft Identity platform for developers.
IHttpClientFactory myHttpClientFactory = new MyHttpClientFactory();
AuthenticationContext authenticationContext = new AuthenticationContext(
authority: "https://login.microsoftonline.com/common",
validateAuthority: true,
tokenCache: TokenCache.DefaultShared,
httpClientFactory: myHttpClientFactory);
When using Xamarin iOS, it is recommended to create an HttpClient that explicitly uses the NSURLSession
-based handler for iOS 7 and newer. ADAL.NET will automatically create an HttpClient that uses NSURLSessionHandler
for iOS 7 and newer. See the Xamarin iOS documentation for HttpClient for more information.
- Home
- Why use ADAL.NET?
- Register your app with AAD
- AuthenticationContext
- Acquiring Tokens
- Calling a protected API
- Acquiring a token interactively
- Acquiring tokens silently
- Using Device Code Flow
- Using Embedded Webview and System Browser in ADAL.NET and MSAL.NET
- With no user
- In the name of a user
- on behalf of (Service to service calls)
- by authorization code (Web Apps)
- Use async controller actions
- Exception types
- using Broker on iOS and Android
- Logging
- Token Cache serialization
- User management
- Using ADAL with a proxy
- Authentication context in multi-tenant scenarios
- Troubleshooting MFA in a WebApp or Web API
- Provide your own HttpClient
- iOS Keychain Access