5 thoughts on “AAD Login on HoloLens 2

  1. Hi Pete,

    First of all thanks for this awesome tutorial, this is a topic rarely covered properly and you have done it very clearly.
    Could you please do a tutorial on using MSAL with Unity iOS or Android app?
    I have used both Amazon SDK and Firebase which integrate with AR/VR apps very easily.
    I don’t understand why Microsoft doesn’t provide the same level of flexibility in the MR space.

    1. I agree, and I think a sample/tutorial showing a VR/AR app accessing Azure services across platforms; iOS/Android/Windows MR/HoloLens/Windows Desktop would be really useful. If I get chance (I don’t think I will unfortunately) but would like to extend this sample (or a better scenario) to include those platforms and maybe discuss design decisions across those platforms. I wonder if the Azure Spatial Anchors samples might help as they are x-plat https://github.com/Azure/azure-spatial-anchors-samples.

  2. HI Pete, thank you for the detailed explanations on your tutorial.
    It helped me get through all the steps of deploying your sample app to HL2.

    I got an issue though when attempting AD authentication using MSAL.
    The app fails to show the interactive login dialog, and shows these errors instead (displayed on the main panel + UnityPlayer.log):

    [1]
    An error occurred while sending the request
    UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    UnityEngine.Logger:Log(LogType, Object)
    UnityEngine.Debug:Log(Object)
    AuthManager:Log(String, Boolean)
    System.Threading.ThreadStart:Invoke()
    d__4:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
    UnityEngine.MonoBehaviour:StartCoroutine_Auto(IEnumerator)
    System.Threading.ThreadStart:Invoke()
    UnityMainThreadDispatcher:Update()

    (Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

    [2]
    Object reference not set to an instance of an object.
    UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    UnityEngine.Logger:Log(LogType, Object)
    UnityEngine.Debug:Log(Object)
    AuthManager:Log(String, Boolean)
    System.Threading.ThreadStart:Invoke()
    d__4:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
    UnityEngine.MonoBehaviour:StartCoroutine_Auto(IEnumerator)
    System.Threading.ThreadStart:Invoke()
    UnityMainThreadDispatcher:Update()

    I contacted MS Support, they asked to upgrade MSAL from 4.9.0 to 4.29.0, which I did and I also tried other things like changing platform settings (under inspector / plugin). Did you run into these same issues?

    1. Hi Houssam,

      I don’t recall seeing similar issues, are you using the same MSAL version that I used in my sample? I just tried an old build of that sample with the latest insider OS and I see the dialog as expected.

      Could you find the full unity log from your HoloLens device and send to my email address in the about page of this blog?
      You can find the log using the HoloLens developer portal File Explorer with the path:

      User Folders\LocalAppData\\TempState\UnityPlayer.log
      (Terminate the app if it is running otherwise the log file won’t get flushed to disk).

      Pete

      1. I am using the same MSAL version that’s in your sample, which is 4.9.0.
        It is worth noting that MS Support asked me to upgrade it to 4.27+ because of a known issue in MSAL prior to 4.27. So I updated the MSAL under Plugins/MSAL/Placeholder to 4.29.0 and updated the platform settings to match your sample’s (Editor / Any CPU / Any OS). And I removed the one under Plugins/MSAL. Redeployed to HL2 and got the same exception.
        I will send the log shortly.
        Regards
        Houssam

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.