In this video, start an ASPNET project that authenticates with Azure AD, and learn the nuGet packages you need.
- [Instructor] Let's go ahead and write a simple application, a web application, using Visual Studio, that will have the ability to sign in to Office 365 Azure AD. So go ahead and fire up Visual Studio. I'm using 2017, you can use 2015 or 2017. File, New, Project, and go to Web. And chose ASP dot NET Framework Web Application.
I'm also going to go ahead and bump up the dot NET version over here. And let's go ahead and put this in c:\code, and let's call this AzureADWebApp. Let's put this in c:\developer, and call it AzureADWebApp. Hit OK. Now soon as the Application Wizard starts open, it asks you to configure the application. We wish to use MVC and I'll go with No Authentication, but let me show you the choices we have here.
So we can go ahead and click this Change Authentication button and it shows me the various choices I have here. No Authentication is what I have. But I thought we were going to authenticate this application using Azure AD? Yes, but I wish to write that code myself so I can explain it as I write it. The other choice is Individual applications, Social Accounts or a SQL Server backed database, Work or School Accounts, and the code generated here would actually be very similar to the code we're about to write.
But we want to see what's going on behind the scenes, so we won't pick that. And Window's Authentication is your typical Kerberos, NTLM, that sort of authentication. So choose No Authentication, hit OK, click OK, and let's wait for the application to get created. Once the application is created, go ahead and select the application here and look at the Properties Pane. Now Azure AD sort of insists that everything you do should be SSL, and more and more platforms are insisting that we do this.
It's a good idea to even do that during Dev times, so go ahead and change this SSL name from False to True. And this SSL URL localhost:44303, we will need this URL very shortly, but we'll grab that in a second. Now in the same application I want to add a few NuGet packages. So go ahead and launch package manager console, and that should pop open a window that looks like this.
And lets go ahead and add a bunch of NuGet packages. So first let me show you what NuGet packages I wish to add in Notepad. Now not all of these packages are compatible with each other, especially when it comes to the latest versions. So one of these packages specifically, I have to install an older version. This is just how things are. So I'm going to go ahead and install all of these packages. Once all these packages are successfully installed, we can now move to the next step.
- What is Microsoft Graph?
- Registering a web application in Azure AD
- Adding authentication logic and authentication UI
- Native applications calling Graph
- Reviewing scenarios where web apps involving Graph are useful
- Web applications with application identity and delegated identity calling Graph
- Daemons calling Graph