Book Image

Azure Active Directory for Secure Application Development

By : Sjoukje Zaal
Book Image

Azure Active Directory for Secure Application Development

By: Sjoukje Zaal

Overview of this book

Azure Active Directory for Secure Application Development is your one-stop shop for learning how to develop secure applications using modern authentication techniques with Microsoft Azure AD. Whether you’re working with single-tenant, multi-tenant, or line-of-business applications, this book contains everything you need to secure them. The book wastes no time in diving into the practicalities of Azure AD. Right from the start, you’ll be setting up tenants, adding users, and registering your first application in Azure AD. The balance between grasping and applying theory is maintained as you move from the intermediate to the advanced: from the basics of OAuth to getting your hands dirty with building applications and registering them in Azure AD. Want to pin down the Microsoft Graph, Azure AD B2C, or authentication protocol best practices? We’ve got you covered. The full range of Azure AD functionality from a developer perspective is here for you to explore with confidence. By the end of this secure app development book, you’ll have developed the skill set that so many organizations are clamoring for. Security is mission-critical, and after reading this book, you will be too.
Table of Contents (14 chapters)
Part 1: Getting Started with the Microsoft Identity Platform
Part 2: Authentication and Protocols
Part 3: Azure AD B2C

Setting up the custom web application

In the last part of this chapter, we are going to set up the web application. We are not going to build this application completely from scratch because this way we will repeat a lot of actions that we already did in the previous chapters. Setting up the application code for an application that authenticates against Azure AD B2C is similar to connecting an application to Azure Active Directory. They both use OAuth 2 and OpenID Connect, and the SDKs are the same as well. For this demonstration, we are going to use the sample application from the GitHub folder. The download link can be obtained from the Technical requirements section at the beginning of this chapter.

We will only make the required changes to connect to the Azure AD B2C tenant and add the correct user flow to web.config:

  1. Download the sample code from GitHub and open the sample application in the Chapter 7 folder.
  2. Open the application in Visual Studio and open appsettings...