We are going to go over how to implement Microsoft login inside your application on Windows 10 apps and Xbox One apps.
We used to use the old login endpoint login.microsoft.com to login our users and today we have update our app to use the new graph endpoint from Microsoft you can download the nuget package called Microsoft.Graph and also Microsoft.Identity.Client.
Microsoft has greatly improved how you can login to its API compared to how I used to login or it might have been me that was not doing the best way.
Next we will try to login a user using the MS documentation. We are using simple scopes for our login "user.read" and our ClientId was registered in our Azure portal.
The login code:
The app will register to the MS Graph API and will ask the user to login, which will generate the Microsoft login window.
We will not go over the methods call SignInUserAndGetTokenUsingMSAL and SignInAndInitializeGraphServiceClient as I would be saying the same thing as the Microsoft documentation which can be found here.