Closed andrewleader closed 5 years ago
Seems like this is actually a conflict with the other Microsoft.IdentitySomething library. After switching to Microsoft.Identity.Client, everything worked as expected. Very confusing that there's both of these with the same classes.
Hi @andrewleader! Really sorry for the long delay!
So basically there is two version of the Azure AD Authentication Library: v1 (aka. ADAL) and v2 (aka. MSAL). MSAL is the new one, but it is in public preview only (but suitable for production use). This sample was migrated from ADAL to MSAL about a year ago.
ADAL uses the Microsoft.IdentityModel.Clients.ActiveDirectory
nuget package and the syntax for the token cache is _cache.BeforeAccess = BeforeAccessNotification;
MSAL uses the Microsoft.Identity.Client
nuget package and the syntax is _cache.SetBeforeAccess(BeforeAccessNotification);
Let me know if it is not clear or if you have any questions!
These two lines need to be updated as they don't seem to exist anymore. https://github.com/microsoftgraph/aspnetcore-connect-sample/blob/963651517128469d2a250917df6985c563e962ef/MicrosoftGraphAspNetCoreConnectSample/Helpers/SessionTokenCache.cs#L31
Instead, they should be the following based on the latest NuGet package