Azure Identity => ERROR in getToken() Exception

Bobby Sharma 5 Reputation points
2023-05-23T11:08:25.5066667+00:00

Hi Team,
I am getting below error when using TokenCachePersistenceOptions with ClientSecretCredential and trying to use cache framework for saving access token using MSAL.java.
Exception:
com.azure.identity.ClientSecretCredential - Azure Identity => ERROR in getToken() call for scopes [https://graph.microsoft.com/.default]: Shared token cache is unavailable in this environment.

It is working fine on my local but when i tried to dockerized my application i am getting this error.
I got same error when i deployed on different machine, but i used UUID as cache name.

TokenCachePersistenceOptions persistenceOptions = new TokenCachePersistenceOptions();persistenceOptions.setName(UUID.randomUUID().toString());

and it starts to work.
But i am getting issue when i tried to dockerize the appplication.

When do we get "Shared token cache is unavailable in this environment.".

Microsoft Security Microsoft Graph
0 comments No comments
{count} vote

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.