-
Notifications
You must be signed in to change notification settings - Fork 49
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
[Authentication] After Uno.Sdk update, MSAL login on Windows using msal redirect url gives Microsoft.Identity.Client.MsalClientException #2443
Comments
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 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 ! |
Afaik opening the account picker in the default browser is the recommended approach as per the latest security standards (instead of the embedded browser) - the docs say so quite overwhelmingly as well - https://learn.microsoft.com/en-us/entra/msal/dotnet/acquiring-tokens/using-web-browsers#embedded-web-view-vs-system-browser |
Correct for a browser based approach - however the desired and recommended behavior on Windows is to use the native WAM, which is built into the OS: Using the native Windows WAM was the behavior up to Uno.Sdk 5.2.139, which was broken in 5.2.175; that is what I referred to in this issue:
@kazo0 I hope that #2631 enables using the native Windows WAM, not an embedded browser? |
@eriklimakc If I'm not mistaken, #2631 should fix this and continue to use the native Windows WAM @VincentH-Net, I'll be working to get this merged today and we can validate |
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:
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)
Environment
Nuget Package (s):
Uno.Sdk packages for:
Package Version(s):
Affected platform(s):
Visual Studio:
The text was updated successfully, but these errors were encountered: