microsoft-authentication-library-for-js
microsoft-authentication-library-for-js copied to clipboard
MSAL default cache is slow - O(n)
Core Library
MSAL Node (@azure/msal-node)
Core Library Version
1.14.2
Wrapper Library
Not Applicable
Wrapper Library Version
None
Public or Confidential Client?
Confidential
Description
We had an issue that msal token exchange requests were becoming slower over time and consuming large portion of CPU time. After an internal discussion it was concluded that in-memory cache operates in O(n) complexity. This bug was open to track this issue.
Error Message
No response
Msal Logs
No response
MSAL Configuration
auth: {
clientId: clientId,
clientCertificate: {
privateKey: cert.privateRSAKey,
thumbprint: cert.publicCER.getThumbprintHex(),
x5c: cert.publicCER.asPEM()
}
},
system: {
networkClient: this.httpModule
}
Relevant Code Snippets
acquireTokenOnBehalfOf(request);
acquireTokenByClientCredential(request);
Reproduction Steps
We had an issue that msal token exchange requests were becoming slower over time and consuming large portion of CPU time. After an internal discussion it was concluded that in memory cache operates in O(n) complexity.
Expected Behavior
Cache performance should be O(n)
Identity Provider
Azure AD / MSA
Browsers Affected (Select all that apply)
None (Server)
Regression
No response
Source
Internal (Microsoft)
This issue requires attention from the MSAL.js team and has not seen activity in 5 days. @hectormmg, @bgavrilMS, @Robbie-Microsoft please follow up.
This issue requires attention from the MSAL.js team and has not seen activity in 5 days. @hectormmg, @bgavrilMS, @Robbie-Microsoft please follow up.
Workaround exists:
- create 1 CCA object per request
- provide "knowAuthorities" and "oidcMetadata" as well
This issue requires attention from the MSAL.js team and has not seen activity in 5 days. @hectormmg, @bgavrilMS, @Robbie-Microsoft please follow up.
This issue requires attention from the MSAL.js team and has not seen activity in 5 days. @hectormmg, @bgavrilMS, @Robbie-Microsoft please follow up.
This issue requires attention from the MSAL.js team and has not seen activity in 5 days. @bgavrilMS, @Robbie-Microsoft please follow up.
This issue requires attention from the MSAL.js team and has not seen activity in 5 days. @bgavrilMS, @Robbie-Microsoft please follow up.
This issue requires attention from the MSAL.js team and has not seen activity in 5 days. @bgavrilMS, @Robbie-Microsoft please follow up.
This issue requires attention from the MSAL.js team and has not seen activity in 5 days. @bgavrilMS, @Robbie-Microsoft please follow up.
This issue requires attention from the MSAL.js team and has not seen activity in 5 days. @bgavrilMS, @Robbie-Microsoft please follow up.
@bgavrilMS Do we plan to address this in the near future or is the work around the way to go?