Open VincentH-Net opened 4 months ago
Update: the issue still exists in "Uno.Sdk": "5.3.96"
Hi @VincentH-Net are you still able to reproduce this issue with latest stable Uno.Sdk 5.4.8 please?
Thanks for following up @agneszitte , I will recheck this Monday and update here.
In case the issue still exists, this may help to track it down:
As far as I can see the issue was introduced when a vulnerability in the underlying MS lib forced Uno to update. So to get rid of that vulnerability build warning it is necessary to update the Uno lib and then the issue is that you lose the native UX on Windows.
@agneszitte I rechecked with latest stable "Uno.Sdk": "5.4.8" - the issue still exists
@agneszitte It seems to be this MSAL issue
This comment points to this PR as the example to follow how to use the native Windows broker.
That PR uses both .WithWindowsEmbeddedBrowserSupport()
and .WithBroker(new BrokerOptions(BrokerOptions.OperatingSystems.Windows))
for Windows.
If that does restore the native Windows UX you may need to implement it in the Uno wrapper for MSAL
@agneszitte It seems to be this MSAL issue
This comment points to this PR as the example to follow how to use the native Windows broker.
That PR uses both
.WithWindowsEmbeddedBrowserSupport()
and.WithBroker(new BrokerOptions(BrokerOptions.OperatingSystems.Windows))
for Windows.If that does restore the native Windows UX you may need to implement it in the Uno wrapper for MSAL
@VincentH-Net thanks a lot for the test and all the details, really appreciated ! We will look at the details (cc @jeromelaban, @nickrandolph, @kazo0, @eriklimakc for info)
Current behavior
After updating Uno.Sdk from 5.2.139 to 5.2.175,
IAuthenticationService.LoginAsync
gives this exception on Windows:When downgrading Uno.Sdk back to 5.2.139, there is no exception and the native Windows account picker appears. However, NuGet reports a security vulnerability that is fixed by updating Uno.Sdk, so downgrading is not an acceptable workaround.
MSAL configuration and code:
appsettings.json
App.xaml.cs
LoginViewModel.cs
Workaround
Do what the exception message says: 1) Register an additional desktop application redirect url in Entra Id 2) In code for Windows only, set that URL:
However, this workaround will open the account picker in the web browser instead of use the native Windows account picker.
Expected behavior
I can update to the latest stable Uno Sdk and continue to use the native account picker on Windows with the Uno Auth Extensions.
How to reproduce it (as minimally and precisely as possible)
1) Register an Entra Id application with the msal redirect url 2) Create a new Uno Platform solution with authentication and Windows platform selected 3) Update the solution as shown in the code snippets under "Current Behavior" above 4) Run the app and click on Login
Environment
Nuget Package (s): Uno.Sdk packages for:
Package Version(s):
Affected platform(s):
Visual Studio: