I am using ADAL's (Microsoft.IdentityModel.Clients.ActiveDirectory v4.3.0) AuthenticationContext.AcquireTokenAsync
to acquire a bearer token with a ClientCredential
.
I am creating a new AuthenticationContext
to acquire a token for each request. Is that thread-safe? Or do I have to lock the call to AcquireTokenAsync
with a static SemaphoreSlim
?
I am asking because according to http://www.cloudidentity.com/blog/2013/10/01/getting-acquainted-with-adals-token-cache/ the method uses a static token cache which is not thread-safe, but the article is quite old and I haven't found any more up-to-date information.