Hello everyone.
I'm trying to use Windows Hello Authentication on my Unity/HoloLens2 App.
However I'm having problems with the very first step (checking availability), that's shown in Microsoft's example.
Link: https://learn.microsoft.com/en-us/windows/uwp/security/microsoft-passport-login
When calling Windows.Security.Credentials.KeyCredentialManager.IsSupportedAsync() the App loads a couple of dlls and just stops working.
It does not crash, no error messages. Just a couple of threads exiting with code 0x0 for many minutes (my longest test lasted about 15min, then I stopped the debugging).
Here is my C# code:
using System;
using System.Threading.Tasks;
using UnityEngine;
#if WINDOWS_UWP
using Windows.Security.Credentials;
#endif
namespace MyNamespace
{
public static class KeyCredentialHelper
{
public static async Task<bool> CheckAvailabilityAsync()
{
bool available = false;
#if WINDOWS_UWP
Debug.Log("pre await"); //Get's logged
available = await KeyCredentialManager.IsSupportedAsync(); //Application stops here
Debug.Log("post await"); //Doesn't get logged
#else
Debug.Log("Only Available on UWP!");
#endif
return available
}
}
}
I'm developing in Unity with the MixedReality Toolkit, so the compiler directives are necessary.
And here is the console output from within Visual Studio (after converting to c++):
pre await
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 45)
'unity-project-authenticate.exe' (Win32): Loaded 'C:\Windows\SysArm32\CryptoWinRT.dll'.
'unity-project-authenticate.exe' (Win32): Loaded 'C:\Windows\SysArm32\cryptngc.dll'.
'unity-project-authenticate.exe' (Win32): Loaded 'C:\Windows\SysArm32\ncrypt.dll'.
'unity-project-authenticate.exe' (Win32): Loaded 'C:\Windows\SysArm32\ntasn1.dll'.
'unity-project-authenticate.exe' (Win32): Loaded 'C:\Windows\SysArm32\ngcksp.dll'.
Again, there are no errors, the App "doesn't crash" (It stops working and displaying it's content, but doesn't close).
When I close and reopen the App, a larger version of the loading animation of the HoloLens2 is displayed on eyelevel, but nothing else happens.
Unity 2018.4.23f1
Visual Studio 2019
MRTK 2.4.0 (although this shouldn't have an effect)
What am I missing? Any help greatly appreciated!