4

I am using Windows 10 APIs "Passport" & "Window Hello" in my WPF application.

bool keyCredentialAvailable = await KeyCredentialManager.IsSupportedAsync();
if (keyCredentialAvailable)
{
      KeyCredentialRetrievalResult keyCreationResult = await KeyCredentialManager.RequestCreateAsync("Hi", KeyCredentialCreationOption.ReplaceExisting);

}

RequestCreateAsync method opens the popup which asks for biometric or pin. Which is visible in the screenshot at the back of MainWindow.

I don't have any reference for this Popup that I can bring it in front. Also, I am calling this method on my MainWindow's Loaded method so that it can be confirmed that Main window is loaded fully.

Issue with Popup positioning Issue Right now

Expected Positioning Expected

Heena
  • 2,348
  • 3
  • 32
  • 58
  • Can you show the code you are using, i mean, i have never used this api/feature before, but i have no idea how to test it even if i wanted to – TheGeneral Dec 27 '18 at 08:04
  • @TheGeneral I have updated the question with code and expected result – Heena Dec 27 '18 at 08:52
  • @Heena, did you find the answer since you posted the question? I'm also faced with this issue and searching the solution – Attila Szász Feb 20 '20 at 12:13
  • @Heena I'm facing the same problem, although my application accesses the API differently (it's a Java application that uses WinRT/C++ to access KeyCredentialManager). Did you find anything? – Alex Suzuki Aug 09 '21 at 13:32

2 Answers2

0

First, check whether your function is async.

private async void SignInPassport()
{
 bool keyCredentialAvailable = await KeyCredentialManager.IsSupportedAsync();
 if (keyCredentialAvailable)
 {
  KeyCredentialRetrievalResult keyCreationResult = await KeyCredentialManager.RequestCreateAsync("Hi",KeyCredentialCreationOption.ReplaceExisting);
  }
}

if this does not solve your issue try this microsoft-passport-login

Logan
  • 100
  • 1
  • 10
  • function is Async `private async void MainWindow_LoadedAsync(object sender, RoutedEventArgs e)` – Heena Dec 27 '18 at 09:16
  • I have checked the link you shared. It is in UWP and my app is in WPF. When I create a Release build I face this issue. Will I be able to create the build for UWP and verify the same? – Heena Dec 27 '18 at 09:25
  • Yes, you can create a build for UWP. https://learn.microsoft.com/en-us/windows/uwp/packaging/packaging-uwp-apps#sideload-your-app-package – Logan Dec 27 '18 at 09:48
0

I filed a Github issue with Microsoft's C++/WinRT project, which I use to access the same API, and face the problem.

https://github.com/microsoft/cppwinrt/issues/999#issuecomment-897675623

No solution, but "This usually happens when the parent window isn't set correctly." I have no idea how to set the parent window correctly in this case, as the API does not expose any handles on the popup.

Alex Suzuki
  • 1,083
  • 10
  • 18