ClientCredentialProvider is not thread safe
In getAccessToken() method
if access token is expired then all threads will renew the token.
Also if 1st thread get new token, update the start time and then 2nd thread comes (before updating the access token by 2st thread) in this case 2nd thread get old access token
We will be migrating to Azure.Identity for providing token authentication. We will review this issue during that migration to address this case.
Hi @mrharindra Thanks for reaching out and for the patience. With the release of the v3 of the java SDK, it now integrates with Azure Identity which supports a wide variety of authentication flows out of the box. We strongly encourage you to migrate to this v3 + azure identity, and you can read more about it in this issue. https://github.com/microsoftgraph/msgraph-sdk-java/issues/628
This issue won't be fixed, but I'll leave it open for visibility, and the repository will be archived soon.