microsoft / WindowsAppSDK

The Windows App SDK empowers all Windows desktop apps with modern Windows UI, APIs, and platform features, including back-compat support, shipped via NuGet.
https://docs.microsoft.com/windows/apps/windows-app-sdk/
MIT License
3.79k stars 320 forks source link

Windows.Security.Credentials.KeyCredentialManager.RequestCreateAsync lacks support for Win32 windows, causing the WindowsHello window to not display correctly at the top and failing to authenticate #4290

Open YexuanXiao opened 6 months ago

YexuanXiao commented 6 months ago

Describe the bug

When creating a KeyCredential via Windows.Security.Credentials.KeyCredentialManager.RequestCreateAsync, a WindowsHello window pops up for authenticating the user, but in a non-VS debugger environment, the WindowsHello window is displayed as a bottom window, not at the top, and failing to authenticate.

Steps to reproduce the bug

call Windows.Security.Credentials.KeyCredentialManager.RequestCreateAsync

Expected behavior

WindowsHello window displayed at the top

NuGet package version

Windows App SDK 1.5.1: 1.5.240311000

Packaging type

Packaged (MSIX)

Windows version

Insider Build (26085)

IDE

Visual Studio 2022-preview

Additional context

Everything works fine when using the VS debugger.

Original issue and discussions: https://github.com/microsoft/cppwinrt/issues/999

jonwis commented 6 months ago

The implementation works for Win32 apps, but uses the wrong window for parenting the UI, as you've found. I filed http://task.ms/49689617 for us to track the work internally, and I've asked the team to provide any more guidance they can on this.

zhuxb711 commented 2 months ago

I think this is also an issue on UWP application