question

DamianMavrudis-9646 avatar image
0 Votes"
DamianMavrudis-9646 asked RoyLi-MSFT edited

Using Windows Hello Authentication on HoloLens2

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://docs.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!

not-supported
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

RoyLi-MSFT avatar image
0 Votes"
RoyLi-MSFT answered

Hello,

Welcome to Microsoft Q&A!


Currently, Microsoft Q&A supports the products listed over here: supported topics (more to be added later on).

Your question about Unity and Hololens is not supported yet now. You could ask about this in StackOverflow with Hololens2 and Unity tag.


Thank you.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.