The Mixed Reality Forums here are no longer being used or maintained.
There are a few other places we would like to direct you to for support, both from Microsoft and from the community.
The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.
For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.
If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.
And always feel free to hit us up on Twitter @MxdRealityDev.
ADAL for Unity?
I'm wondering if there a version of ADAL that works with Unity exists? Either that or what method should be used to do Azure AD logins for hololens apps?
Best Answer
-
Rob_VS mod
There are a couple of ways to make this work, depending on what all features your tenant is using. I have not been able to successfully get this to work with MFA.
You can use the ADAL libraries, but had to wrap you code in #if UNITY_UWP blocks to hide it from the Unity editor.
I actually found it a bit easier to authenticate against the OAuth endpoint directly to get my access / refresh tokens. I essentially created a FormUrlEncodedContent with all of the necessary information (grant_type, resource, client_id, username, password, etc...) and then did a post directly to the endpoint.
Once I had my token, I then used that directly against the GraphAPI endpoint to query additional information.
Let me know if you have additional questions
5
Answers
There are a couple of ways to make this work, depending on what all features your tenant is using. I have not been able to successfully get this to work with MFA.
You can use the ADAL libraries, but had to wrap you code in #if UNITY_UWP blocks to hide it from the Unity editor.
I actually found it a bit easier to authenticate against the OAuth endpoint directly to get my access / refresh tokens. I essentially created a FormUrlEncodedContent with all of the necessary information (grant_type, resource, client_id, username, password, etc...) and then did a post directly to the endpoint.
Once I had my token, I then used that directly against the GraphAPI endpoint to query additional information.
Let me know if you have additional questions