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.
1 parent 1490397 commit 7570e8fCopy full SHA for 7570e8f
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