Skip to content
Use Microsoft Auth Library to login to Microsoft Graph API using AAD V2 (either personal MSA or organization login credentials) on #HoloLens. Also includes device flow which is useful for HoloLens to avoid typing passwords using gaze and tap gestures.
C# ShaderLab HLSL
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Assets added some more blog images and fixed up link.xml Jan 18, 2019
Logs upgrade to 2018.3 Jan 3, 2019
MixedRealityToolkit-Unity @ a25d437 re-added submodule as there was some kind of error in git db Nov 24, 2018
Packages upgrade to 2018.3 Jan 3, 2019
ProjectSettings added link.xml file to ensure that types, properties, etc. do not get… Jan 7, 2019
img
.gitignore upgrade to 2018.3 Jan 3, 2019
.gitmodules re-added submodule as there was some kind of error in git db Nov 24, 2018
LICENSE
README.md Update README.md Jan 17, 2019
blog.md added some more blog images and fixed up link.xml Jan 18, 2019

README.md

MSAL HoloLens

Use Microsoft Auth Library to login to Microsoft Graph API using AAD V2 (either personal MSA or organization login credentials) on #HoloLens see http://peted.azurewebsites.net/microsoft-graph-auth-on-hololens/ for further details.

The original version is tagged here https://github.com/peted70/msal-hololens/tree/v1.0

The project uses the Mixed Reality Toolkit as a git submodule. To clone you can use the following command:

git clone --recurse-submodules https://github.com/peted70/msal-hololens.git

and then to create a symbolic link from the location of the MRTK on disk to the Assets folder in the Unity project use:

mklink /j .\Assets\HoloToolkit .\MixedRealityToolkit-Unity\Assets\HoloToolkit

The current master branch has moved on to include a device code flow which AAD has subsequently added support for. See https://oauth.net/2/grant-types/device-code/. The device code flow allows login from a device that doesn't have a browser so the flow will wait whilst the user logs ion from another device such as a mobile phone.

**Note that this doesn't currently work with a personal account. Note also that in order to achieve compatibility between the HoloLens app generated by Unity version 2018.2.15f1 and the latest Microsoft.Client.Identity library 2.5.0-preview I needed to upgrade the Microsoft.NETCore.UniversalWindowsPlatform Nuget to v6.2.2 This is not an issue using 2018.3.x **

Unity Editor Screenshot

When options are given for 'sign in' and 'sign out' utter the phrase 'code flow' to initiate the OAuth flow

After the flow is initiated navigate a browser on the second device to https://microsoft.com/devicelogin and input the code provided by the HoloLens app UI. Once this has completed the login will complete, if successful and show the top 5 emails from the logged in users' account.

See https://peted.azurewebsites.net/microsoft-graph-auth-on-hololens-device-code-flow/ for further details.

IL2CPP

This demo was orignally developed in both the Unity editor and using the .NET backend. Since Unity are seeking to deprecate the .NET backend in favour of IL2CPP it makes sense to create demos that are tested in this environment. This caused a few issues that I needed to overcome which are exacerbated by the use of third-party libraries. Please see xxx for further details and my experience of working with IL2CPP.

You can’t perform that action at this time.