Replies: 1 comment 2 replies
-
Are your instances of MSAL CCA in the same application? Or different? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The scenario is multiple instances of
IConfidentialClientApplication
callingAcquireTokenForClient
with the resulting token to be shared among all of them. The distributed cache is the answer and reading this document suggests the L1/L2 combination would be even better.The expected flow.
Initialization:
Ongoing:
However, from my testing it doesn't appear to work that way. In 2. above the instance does not check the distributed and goes straight to AAD and then updates both caches. All the other instances follow suit since they act strictly based on their in-memory caches. Hence, the only benefit of L2 cache is for any new instance initial coming up. The ongoing long-living instances have no benefit at all.
I can make L2 cache work as desired if I disable L1 cache via
MsalDistributedTokenCacheAdapterOptions.DisableL1Cache
. But that would obviously eliminate L1 benefits.Is this the current and intended implementation or am I missing something? Thanks.
Beta Was this translation helpful? Give feedback.
All reactions