Skip to content

Commit b86750c

Browse files
Fix Bug for Disable WAM Auth Flow (#3521)
* Adjust patch version and fix issue where disabling wam with client ID wont show pop up window * Remove duplicated code
1 parent efbc349 commit b86750c

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

config/ModuleMetadata.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@
2727
"versions": {
2828
"authentication": {
2929
"prerelease": "",
30-
"version": "2.35.0"
30+
"version": "2.35.1"
3131
},
3232
"beta": {
3333
"prerelease": "",
34-
"version": "2.35.0"
34+
"version": "2.35.1"
3535
},
3636
"v1.0": {
3737
"prerelease": "",
38-
"version": "2.35.0"
38+
"version": "2.35.1"
3939
}
4040
}
4141
}

src/Authentication/Authentication.Core/Utilities/AuthenticationHelpers.cs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -126,17 +126,12 @@ private static async Task<InteractiveBrowserCredential> GetInteractiveBrowserCre
126126
var interactiveBrowserCredential = new InteractiveBrowserCredential(interactiveOptions);
127127
if (ShouldUseWam(authContext))
128128
{
129-
authRecord = await Task.Run(() =>
130-
{
131-
// Run the thread in MTA.
132-
GraphSession.Instance.OutputWriter.WriteWarning("Note: Sign in by Web Account Manager (WAM) is enabled by default on Windows. If using an embedded terminal, the interactive browser window may be hidden behind other windows.");
133-
return interactiveBrowserCredential.Authenticate(new TokenRequestContext(authContext.Scopes), cancellationToken);
134-
});
129+
GraphSession.Instance.OutputWriter.WriteWarning("Note: Sign in by Web Account Manager (WAM) is enabled by default on Windows. If using an embedded terminal, the interactive browser window may be hidden behind other windows.");
135130
}
136-
else
131+
authRecord = await Task.Run(() =>
137132
{
138-
authRecord = await interactiveBrowserCredential.AuthenticateAsync(new TokenRequestContext(authContext.Scopes), cancellationToken);
139-
}
133+
return interactiveBrowserCredential.Authenticate(new TokenRequestContext(authContext.Scopes), cancellationToken);
134+
});
140135
await WriteAuthRecordAsync(authRecord).ConfigureAwait(false);
141136
return interactiveBrowserCredential;
142137
}

0 commit comments

Comments
 (0)