-
Notifications
You must be signed in to change notification settings - Fork 345
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
[Bug] Unable to use WAM in Unity 2021 #2765
Comments
@eusebiu - MSAL needs to call WAM via Windows API (COM) invocation. To do this, we had to add a reference to https://www.nuget.org/packages/Microsoft.Windows.SDK.Contracts/10.0.17763.1000 which provides these APIs. Can you consume this package directly in a Unity project? If not, we should follow up with the respective team. I am not sure they plan on supporting Mono. |
After installing the Desktop package using NuGet for Unity (which installs the dependencies too), I still get errors: Assembly 'Assets/Packages/Microsoft.Identity.Client.Desktop.4.34.0/lib/net461/Microsoft.Identity.Client.Desktop.dll' will not be loaded due to errors: |
Hitting the same issue here when trying to enable WAM use with MSAL in Unity. Do we have any updates or workarounds on that issue? |
@eusebiu I see this is from some time ago. Did you get to find any workaround for the issue? |
We don't have any updates on the issue. We are exploring a different mechanism to call into WAM, but don't have an ETA. @vaoliva - do you need to support both AAD and MSA accounts? Can you call WAM directly instead of through MSAL? This sample shows how you can do it for AAD accounts, but should be similar for MSA accounts: https://github.com/azure-samples/active-directory-dotnet-native-uwp-wam |
I ended up using Interactive - see here: #2766 (comment) |
This should be fixed with our newer WAM implementation, see https://aka.ms/msal-net-wam |
Logs and network traces
None
Which version of MSAL.NET are you using?
4.34 - the Microsoft.Identity.Client.dll is added as a Unity plugin (for Editor and Standalone only)
Platform
.NET 4.5, Unity 2021
What authentication flow has the issue?
Is this a new or existing app?
This is a new app or experiment.
Repro
Expected behavior
The login popup appears or account is detected.
Actual behavior
Errors appear in the log - nothing happens.
Assembly 'Assets/Plugins/MSAL/Microsoft.Identity.Client.Desktop.dll' will not be loaded due to errors:
Unable to resolve reference 'Windows.Foundation.FoundationContract'. Is the assembly missing or incompatible with the current platform?
Reference validation can be disabled in the Plugin Inspector.
Unable to resolve reference 'Windows.Foundation.UniversalApiContract'. Is the assembly missing or incompatible with the current platform?
Reference validation can be disabled in the Plugin Inspector.
Unable to resolve reference 'System.Runtime.WindowsRuntime'. Is the assembly missing or incompatible with the current platform?
Reference validation can be disabled in the Plugin Inspector.
If I disable Validate references I get this:
Error: Could not load signature of Microsoft.Identity.Client.Platforms.WebAuthenticationCoreManagerInterop:RequestTokenForWindowAsync due to: Could not load file or assembly 'Windows.Foundation.FoundationContract, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. assembly:Windows.Foundation.FoundationContract, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null type: member:(null) signature:
PlatformNotSupportedException: 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.
Microsoft.Identity.Client.PublicClientApplicationBuilder.WithBroker (System.Boolean enableBroker) (at :0)
The text was updated successfully, but these errors were encountered: