msgraph-sdk-java-auth icon indicating copy to clipboard operation
msgraph-sdk-java-auth copied to clipboard

ClientCredentialProvider is not thread safe

Open mrharindra opened this issue 5 years ago • 2 comments

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

AB#7122

mrharindra avatar Sep 24 '20 13:09 mrharindra

We will be migrating to Azure.Identity for providing token authentication. We will review this issue during that migration to address this case.

MIchaelMainer avatar Sep 24 '20 20:09 MIchaelMainer

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.

baywet avatar Mar 16 '21 12:03 baywet