Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

Updating to MSAL.NET 4.16 #38

Merged
merged 3 commits into from
Jul 7, 2020
Merged

Updating to MSAL.NET 4.16 #38

merged 3 commits into from
Jul 7, 2020

Conversation

jmprieur
Copy link
Contributor

@jmprieur jmprieur commented Jul 6, 2020

Updating to MSAL.NET 4.16

  • using the SuggestedCacheKey of TokenCacheNotificationArgs as the cache key
  • using the HasTokens of TokenCacheNotificationArgs to remove the record corresponding to the user when there are no longer any token in the cache for the user (after signout)

// if the access operation resulted in a cache update
if (args.HasStateChanged)
{
string cacheKey = GetMsalAccountId();
string cacheKey = args.SuggestedCacheKey ?? args.Account?.HomeAccountId?.Identifier;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Workaround to a current bug in MSAL.NET that @bgavrilMS is fixing.

string cacheKey = GetMsalAccountId();

if (string.IsNullOrWhiteSpace(cacheKey))
string cacheKey = args.SuggestedCacheKey ?? args.Account?.HomeAccountId?.Identifier;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Workaround to a current bug in MSAL.NET that @bgavrilMS is fixing.

@jmprieur jmprieur merged commit 5ee5e3d into master Jul 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants