Skip to content

Unable to access Token Cache using silent call #585

@lorcan2025

Description

@lorcan2025

We have been fetching Microsoft's access token via normal calls however we were getting throttled due to the huge increase in number of fresh access token calls. On checking we found out that we should use acquire token silently first, and only then fall back to the acquireToken API.
We are using version 1.10.0 and when I tried to implement the silent call, it is unable to fetch tokens from cache and fresh calls are being made.
Our usecase - Whenever there is a file upload, a lambda gets triggered which fetches accessToken from Microsoft and submits the file to Microsoft. At times there are 10k+ files which cause issues as there are 10k requests made to fetch new access tokens. Using cache would help us a lot for such cases.

Code pointer -
Screenshot 2023-01-23 at 1 33 57 PM

The ConfidentialClientApplication is initialised at the very beginning in a static block to avoid it being reinitialised :

Screenshot 2023-01-23 at 1 35 37 PM

Metadata

Metadata

Assignees

Labels

BugSomething isn't working, needs an investigation and a fixQuestionAny questions about how MSAL Java worksconfidential-clientFor issues related to confidential client apps

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions