You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected behavior
Should return a token, if one is present in the token cache.
Actual behavior
On a Samsung Galaxy S9 we get the following exception thrown:
System.ArgumentException: An item with the same key has already been added. Key: User-Agent
at System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior)
at System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value)
at System.Net.Http.Headers.HttpHeaders.GetValues[T] (System.String name)
at System.Net.Http.Headers.HttpRequestHeaders.get_UserAgent ()
at Microsoft.Identity.Client.Http.HttpManager+<ExecuteAsync>d__9.MoveNext ()
at Microsoft.Identity.Client.Http.HttpManager+<ExecuteWithRetryAsync>d__8.MoveNext ()
at Microsoft.Identity.Client.Http.HttpManager+<SendGetAsync>d__5.MoveNext ()
at Microsoft.Identity.Client.OAuth2.OAuth2Client+<ExecuteRequestAsync>d__10`1[T].MoveNext ()
at Microsoft.Identity.Client.OAuth2.OAuth2Client+<DiscoverAadInstanceAsync>d__8.MoveNext ()
at Microsoft.Identity.Client.Instance.AadInstanceDiscovery+<SendInstanceDiscoveryRequestAsync>d__12.MoveNext ()
at Microsoft.Identity.Client.Instance.AadInstanceDiscovery+<DoInstanceDiscoveryAndCacheAsync>d__7.MoveNext ()
at Microsoft.Identity.Client.Instance.AadInstanceDiscovery+<GetMetadataEntryAsync>d__6.MoveNext ()
at Microsoft.Identity.Client.TokenCache+<GetCachedOrDiscoverAuthorityMetaDataAsync>d__59.MoveNext ()
at Microsoft.Identity.Client.TokenCache+<Microsoft-Identity-Client-ITokenCacheInternal-FindRefreshTokenAsync>d__55.MoveNext ()
at Microsoft.Identity.Client.Internal.Requests.SilentRequest+<FindRefreshTokenOrFailAsync>d__6.MoveNext ()
at Microsoft.Identity.Client.Internal.Requests.SilentRequest+<ExecuteAsync>d__3.MoveNext ()
at Microsoft.Identity.Client.Internal.Requests.RequestBase+<RunAsync>d__13.MoveNext ()
at Microsoft.Identity.Client.ApiConfig.Executors.ClientApplicationBaseExecutor+<ExecuteAsync>d__2.MoveNext ()
at Microsoft.Identity.Client.ClientApplicationBase+<AcquireTokenSilentAsync>d__22.MoveNext ()
After some testing today, we found out that AcquireTokenSilentAsync was being called from multiple places at the same time. Apparently the method is not thread-safe, as it is calling HttpRequestHeaders.UserAgent on a shared header.
Which Version of MSAL are you using ?
MSAL 3.0.1-preview
Platform
Xamarin Android
What authentication flow has the issue?
Other? - please describe;
Is this a new or existing app?
a. The app is in production, and I have upgraded to a new version of MSAL
Repro
Expected behavior
Should return a token, if one is present in the token cache.
Actual behavior
On a Samsung Galaxy S9 we get the following exception thrown:
Possible Solution
Additional context/ Logs / Screenshots
Add any other context about the problem here, such as logs and screebshots. Logging is described at https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/wiki/logging
The text was updated successfully, but these errors were encountered: