-
Notifications
You must be signed in to change notification settings - Fork 214
WAM Integration #1344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WAM Integration #1344
Conversation
src/Authentication/Authentication.Core/Microsoft.Graph.Authentication.Core.csproj
Outdated
Show resolved
Hide resolved
|
Since we are using MSAL 4.44.X in this implementation, you may want to wait for Otherwise, we you'll also need to ensure the prerequisites in https://docs.microsoft.com/en-us/azure/active-directory/develop/scenario-desktop-acquire-token-wam#availability are met for it to work across multiple targets. |
One question @peombwa -- do we need to make this behaavior opt-in via |
@adamedx, good point! We should make this an opt-in feature since WAM has couple of limitations that customers may have a hard time with:
MSAL's implementation is OS aware, and should fallback to a browser when WAM is not supported. See https://docs.microsoft.com/en-us/azure/active-directory/develop/scenario-desktop-acquire-token-wam#wam-limitations. |
@FehintolaObafemi, I'm getting the following errors when I run ➜ .\tools\GenerateAuthenticationModule.ps1 -Build -Run
➜ Connect-MgGraph
Connect-MgGraph: InteractiveBrowserCredential authentication failed: If you have a Windows application which targets net5 or net5-windows, please change the target to net5-windows10.0.17763.0.
Your app can still run on earlier versions of Windows such as Win7 if you add <SupportedOSPlatformVersion>7</SupportedOSPlatformVersion> in the csproj.
The broker (WAM) is available only on Win10 and this library will fallback to a browser on older systems.
If you have a NET5 cross-platform (Windows, Mac, Linux) application, please dual target net5 and net5-windows10.0.17763.0. Your installer should deploy the net5 version on Mac and Linux and the net5-window10.0.17763.0 on Windows.
If you have a .NET Core 3.1 application, please install the NuGet package named Microsoft.Identity.Client.Desktop and call the extension method .WithWindowsBroker() first.
If you want to try the new broker preview, please install the NuGet package named Microsoft.Identity.Client.Broker and call the extension method .WithBrokerPreview().
For details see https://aka.ms/msal-net-wam and https://github.com/dotnet/designs/blob/main/accepted/2020/platform-checks/platform-checks.md |
@peombwa I can't seem to recreate this error on my end following the step you highlighted above. |
|
@FehintolaObafemi, are you getting a WAM account picker pop up when you sign in? If not, then you are using an access token from the cache and not going through WAM. Run The issue is also present in PowerShell 5.1 as of commit # Connect-MgGraph : InteractiveBrowserCredential authentication failed: The Windows broker is not directly available on MSAL for .NET
Framework To use it, please install the NuGet package named Microsoft.Identity.Client.Desktop and call the extension method
.WithWindowsBroker() first.If you want to try the new broker preview, please install the NuGet package named
Microsoft.Identity.Client.Broker and call the extension method .WithBrokerPreview().
At line:1 char:1
+ Connect-MgGraph
+ ~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Connect-MgGraph], AuthenticationFailedException
+ FullyQualifiedErrorId : Microsoft.Graph.PowerShell.Authentication.Cmdlets.ConnectMgGraphWe can sync offline for the repro steps. |
@peombwa , @maisarissi, suggestion for how to expose it? Should it be a preference variable, or just a new option, e.g. |
@adamedx, I like the idea of having a @FehintolaObafemi, let's make
See -ContextScope example as a reference. |
Agreed! I like this idea. |
|
@FehintolaObafemi , once everything looks good, would be great to rebase this into a smaller set of commits to simplify the change log. |
1e78b82 to
def70ed
Compare
7e78289 to
b5c0598
Compare
24cffe1 to
56464e8
Compare
src/Authentication/Authentication.Core/Utilities/AuthenticationHelpers.cs
Outdated
Show resolved
Hide resolved
src/Authentication/Authentication.Core/Utilities/AuthenticationHelpers.cs
Outdated
Show resolved
Hide resolved
|
@FehintolaObafemi, I've resolved the |
|
Issue has been filed with the Azure Identity team |
c59a506 to
50f6484
Compare
2e0b06b to
4a91429
Compare
4a91429 to
e6197fd
Compare
75cc8b9 to
53066fd
Compare
53066fd to
616ef71
Compare
7ebe788 to
66c90df
Compare
8cbf0c0 to
e5719c9
Compare
4557f1c to
06348fd
Compare
4e66090 to
cb9f2a6
Compare
da6576c to
7e0372e
Compare
7e0372e to
10d1ac1
Compare
2d7c97b to
7a18adc
Compare
7a18adc to
7329697
Compare
|
Continued in #2034 due to this PR being closed on accident and not re-opening. |
Fixes #1133
Changes proposed in this pull request
Other links