We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 754cbe4 + 42d4aae commit 1cc6066Copy full SHA for 1cc6066
src/Authentication/Authentication.Core/Utilities/AuthenticationHelpers.cs
@@ -133,7 +133,11 @@ private static async Task<InteractiveBrowserCredential> GetInteractiveBrowserCre
133
}
134
else
135
{
136
- authRecord = await interactiveBrowserCredential.AuthenticateAsync(new TokenRequestContext(authContext.Scopes), cancellationToken).ConfigureAwait(false);
+ authRecord = await Task.Run(() =>
137
+ {
138
+ // Run the thread in MTA.
139
+ return interactiveBrowserCredential.AuthenticateAsync(new TokenRequestContext(authContext.Scopes), cancellationToken);
140
+ });
141
142
await WriteAuthRecordAsync(authRecord).ConfigureAwait(false);
143
return interactiveBrowserCredential;
0 commit comments