Microsoft.Identity.Web Library
Microsoft.Identity.Web
Microsoft.Identity.Web version
3.x
Web app
Not Applicable
Web API
Not Applicable
Token cache serialization
Not Applicable
Description
TokenAcquirerFactory.GetDefaultInstance() and TokenAcquirerFactory.Build() should be thread safe.
Reproduction steps
Keep executing the code below from multiple threads. The code shouldn't be in a loop, as the race condition is specifically around the initialization of the singleton.
The program should be started again for the race condition to appear.
var instance = TokenAcquirerFactory.GetDefaultInstance();
if(instance.ServiceProvider == null)
{
instance.Build();
}
Error message
No response
Id Web logs
No response
Relevant code snippets
var instance = TokenAcquirerFactory.GetDefaultInstance();
if(instance.ServiceProvider == null)
{
instance.Build();
}
Regression
No response
Expected behavior
TokenAcquirerFactory.GetDefaultInstance() and TokenAcquirerFactory.Build() should be thread safe.
Microsoft.Identity.Web Library
Microsoft.Identity.Web
Microsoft.Identity.Web version
3.x
Web app
Not Applicable
Web API
Not Applicable
Token cache serialization
Not Applicable
Description
TokenAcquirerFactory.GetDefaultInstance() and TokenAcquirerFactory.Build() should be thread safe.
Reproduction steps
Keep executing the code below from multiple threads. The code shouldn't be in a loop, as the race condition is specifically around the initialization of the singleton.
The program should be started again for the race condition to appear.
var instance = TokenAcquirerFactory.GetDefaultInstance();
if(instance.ServiceProvider == null)
{
instance.Build();
}
Error message
No response
Id Web logs
No response
Relevant code snippets
Regression
No response
Expected behavior
TokenAcquirerFactory.GetDefaultInstance() and TokenAcquirerFactory.Build() should be thread safe.