MSAL.NET Version 3.0.0-preview
Pre-release
Pre-release
- For more info on the release, along with code samples, checkout https://aka.ms/msal-net-3x
Breaking changes in MSAL.NET 3:
UIBehaviorwas renamed toPrompt(breaking change)TokenCacheNotificationArgsnow surfaces anITokenCacheinstead of aTokenCache. This will allow MSAL.NET to provide, in the future, various token cache implementations.TokenCacheExtensionswas removed and its methods moved toITokenCache(this is a binary breaking change, but not a source level breaking change)- The
SerializeandDeserializemethods onTokenCacheExtention(which were serializing/deserializing the cache to the MSAL v2 format) were moved toITokenCacheand renamedSerializeMsaV2and `DeserializeV2
Changes related to improving app Creation and configuration MSAL issue
- New class
ApplicationOptionshelps you build an application, for instance, from a configuration file - New interface
IMsalHttpClientFactoryto pass-in the HttpClient to use by MSAL.NET to communicate with the endpoints of Microsoft identity platform for developers. - New classes
PublicClientApplicationBuilderandConfidentialClientApplicationBuilderpropose a fluent API to instantiate respectively classes implementingIPublicClientApplicationandIConfidentialClientApplicationincluding from configuration files, setting the targetted cloud and audience, but also setting per application logging and telemetry, and setting theHttpClient. - New delegates
TelemetryCallbackandTokenCacheCallbackcan be set at application construction - New enumerations
AadAuthorityAudienceandAzureCloudInstancehelp you writing applications for sovereign and national clouds, and help you choose the audience for your application.
Changes related to improving token acquisition, addressing issues 810, 635, 426, 799 :
ClientApplicationBasenow implementsIClientApplicationBaseand has new members:AppConfigof new typeIAppConfigcontains the configuration of the applicationUserTokenCacheof new typeITokenCachecontains the user token cache (for both public and confidential client applications for all flows, butAcquireTokenForClient)- New fluent API
AcquireTokenSilent
- New fluent API
PublicClientApplicationandIPublicClientApplicationhave four new fluent APIs:AcquireTokenByIntegratedWindowsAuth,AcquireTokenByUsernamePassword,AcquireTokenInteractive,AcquireTokenWithDeviceCode.ConfidentialClientApplicationhas new members:AppTokenCacheused byAcquireTokenForClient- Five new fluent APIs:
AcquireTokenByAuthorizationCode,AcquireTokenForClient,AcquireTokenOnBehalfOf,GetAuthorizationRequestUrl,IByRefreshToken.AcquireTokenByRefreshToken
- New extensibility mechanism to enable public client applications to provide, in a secure way, their own browsing experience to let the user interact with the Microsoft identity platform endpoint (advanced). For this, applications need to implement the
ICustomWebUiinterface and throwMsalCustomWebUiFailedExceptionexceptions in case of failure. This can be useful in the case of platforms which don't have yet a Web browser. For instance, the Visual Studio Feedback tool is an Electron application which uses this mechanism. MSAL issue MsalServiceExceptionnow surfaces two new properties:CorrelationIdwhich can be useful when you interact with Microsoft support.SubErrorwhich indicates more details about why the error happened, including hints on how to communicate with the end user. MSAL issue
Changes related to the token cache:
- New interface
ITokenCachecontains primitives to serialize and deserialize the token cache and set the delegates to react to cache changes - New methods
SerializeMsalV3andDeserializeMsalV3onITokenCacheserialize/deserialize the token cache to a new layout format compatible with other MSAL libraries on Windows/Linux/MacOS.
A few bug fixes: