-
Notifications
You must be signed in to change notification settings - Fork 364
Extensibility Points
MSAL adopts the strategy of "make simple scenarios simple, make complex scenarios possible".
Allows apps to adapt highly scalable HttpClient factories such as ASP.NET Core's IHttpClientFactory. Helps desktop and mobile apps which have to deal with complex proxy configurations. Allows apps to fully control the HTTP messages.
Details here
Allows applications to make changes to the /token
request, by providing access to the list of parameters and headers and to the URI where it is performed. Useful for trying out new flows which MSAL doesn't yet support.
public string GetTokenAsync()
{
var result = await app.AcquireTokenForClient(scope)
.OnBeforeTokenRequest(ModifyRequestAsync)
.ExecuteAsync();
// log result.AuthenticationResultMetadata.DurationTotalInMs and other metrics
return result.Token;
}
private static Task ModifyRequestAsync(OnBeforeTokenRequestData requestData)
{
requestData.BodyParameters.Add("param1", "val1");
requestData.BodyParameters.Add("param2", "val2");
requestData.Headers.Add("header1", "hval1");
requestData.Headers.Add("header2", "hval2");
return Task.CompletedTask;
}
Allows apps to add query (GET) parameters to applications, customizing the experience. This mainly controls the UX login experience exposed by the /authorize
endpoint, but the parameters are sent to the /token
endpoint request as well.
Useful to target AAD service slices where new features or bug fixes are deployed first and to customize the UX experience with features not exposed by MSAL. Note that MSAL doesn't perform the /authorize
request in ASP.NET / ASP.NET Core scenarios, so those calls are not affected!
Details here
Allows desktop and mobile apps to use their own browser instead of the embedded / system browsers provided by MSAL.
Details here
- Home
- Why use MSAL.NET
- Is MSAL.NET right for me
- Scenarios
- Register your app with AAD
- Client applications
- Acquiring tokens
- MSAL samples
- Known Issues
- AcquireTokenInteractive
- WAM - the Windows broker
- .NET Core
- Maui Docs
- Custom Browser
- Applying an AAD B2C policy
- Integrated Windows Authentication for domain or AAD joined machines
- Username / Password
- Device Code Flow for devices without a Web browser
- ADFS support
- Acquiring a token for the app
- Acquiring a token on behalf of a user in Web APIs
- Acquiring a token by authorization code in Web Apps
- High Availability
- Token cache serialization
- Logging
- Exceptions in MSAL
- Provide your own Httpclient and proxy
- Extensibility Points
- Clearing the cache
- Client Credentials Multi-Tenant guidance
- Performance perspectives
- Differences between ADAL.NET and MSAL.NET Apps
- PowerShell support
- Testing apps that use MSAL
- Experimental Features
- Proof of Possession (PoP) tokens
- Using in Azure functions
- Extract info from WWW-Authenticate headers
- SPA Authorization Code