-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
changes to the cachekey to use tokenNotificationArgs #279
Conversation
@pmaytak you could probably review this now, i don't expect much to change. If you want to build it and test it, although it's probably easier to wait until MSAL .NET releases. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks. Caching API looks cleaner now. Just a few minor suggestions. I'll take another glance once this PR is finalized.
src/Microsoft.Identity.Web/TokenCacheProviders/IMsalTokenCacheProvider.cs
Show resolved
Hide resolved
src/Microsoft.Identity.Web/TokenCacheProviders/MsalAbstractTokenCacheProvider.cs
Show resolved
Hide resolved
src/Microsoft.Identity.Web/TokenCacheProviders/MsalAbstractTokenCacheProvider.cs
Show resolved
Hide resolved
src/Microsoft.Identity.Web/TokenCacheProviders/Distributed/MsalDistributedTokenCacheAdapter.cs
Outdated
Show resolved
Hide resolved
#294) * This is an improvement leveraging the fact that MSAL.NET now exposes TokenCacheNotificationArgs.HasTokens which enable applications (and Microsoft.Identity.Web) to remove cache entries when the cache is empty Also OnBeforeAccessAsync tests if the SuggestedCacheKey is null (can happen in B2C cases, as we still call GetAccountsAsync() * Removing the un-necessary condition on suggested cache key (which should not be null in a Write to cache) It can be null in a read to cache if for instance, calling GetAccountsAsync() * Removing an extra line * remove secret Co-authored-by: jennyf19 <jeferrie@microsoft.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Thanks @jennyf19 !
Nice improvements.
Next release of MSAL .NET will surface the cache key to use in the tokenNotificationArgs, so we'll use that instead.
Making this draft PR for ease of testing. cc: @jmprieur
#235