You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* updating the token cache providers to prepare
- for MSAL 4.x (which introduces async token cache serialization)
- and also reusing the ConfidentialClientApplication in the TokenAcquisition service (as the cache can now be overriden when it's deserialied)
Problems fixed:
1. The token cache serialization providers used to keep the token cache as a member of the class and applied serialization and deserialization methods to this member.
1. They now use the `TokenCache` provided as a member of the `TokenCacheNotificationArgs`. Using the cache kept in the provider itself will break in MSAL 4.0 where we introduce the async serialization notifications
```Text
NotImplementedException: This is removed in MSAL.NET v4. Read more: https://aka.ms/msal-net-4x-cache-breaking-change
Microsoft.Identity.Client.TokenCache.DeserializeMsalV3(byte[] msalV3State, bool shouldClearExistingCache)
```
1. Given that some of the cache providers are a singleton in ASP.NET Core, there was a race condition (See also point #2).
1. They used to keep the user as a member of the class (the user when the cache was initialized)
1. Again this was a race condition when the provider was a singleton: the Web app was accessed by many users.
1. They how allow us to keep the same instance of ConfidentialClientApplication. This is a new requirement coming from Graph SDK. They use the deserializer override that has a boolean parameter to overrides the cache.
Also fixing:
- the aka.ms link to point to docs.microsoft.com and no longer to the wiki
- renaming the solution
cc: @bgavrilMS@kalyankrishna1@TiagoBrenck
// A user interaction is required, but we are in a Web API, and therefore, we need to report back to the client through an wwww-Authenticate header https://tools.ietf.org/html/rfc6750#section-3.1
0 commit comments