1 min read

Authenticating to and querying Microsoft Graph by using MSAL and .NET SDKs Part 2 – Obtain a token by using the MSAL.NET library

Now we will create a .NET application.

First build a new project.

dotnet new console --name GraphClient --output .
dotnet add package Microsoft.Identity.Client --version 4.7.1
dotnet build

Next modify the code as described in the Lab including the previously copied application and tenant id.

Now save and run the project and sign in to the webapp using your very own email address!

Wow! It’s just that easy!

Next in the final post we’ll modify the code to read some information from the user.

Leave a Reply