AzureAD/azure-activedirectory-library-for-dotnet

Resource in TokenCacheNotificationArgs is null for AfterAccess notification.

sc22github opened this issue · 1 comments

Documentation Related To Component:

TokenCache

Please check those that apply

  • typo
  • documentation doesn't exist
  • documentation needs clarification
  • error(s) in example
  • needs example

Description Of The Issue

I have a distributed cache implementation on top of TokenCache. I have hooked into AfterAccess delegate to add a log which helps find out cache hit rate. I log two values: "HasStateChanged" and "TokenCacheNotificationArgs.Resource". If HasStateChange is false, it's a cache hit, and Resource will tell for which resource the token request was. This worked fine when I was on 4.5.1. I upgraded to 5.2.0, and now I am seeing that args.Resource is null for cache hit scenarios. I could not find any documentation around this change. Is this expected behavior? If yes, is there another way to figure the resource for which token request was made?

Please use MSAL.