Using Azure AD B2C in single-page applications
In an earlier section, we learned how to integrate Azure AD B2C user workflows into an ASP.NET Core MVC application, and how to use them to sign up and sign in to the application. In this section, we will learn how to use Azure AD B2C in a SPA. For simplicity, we are using vanilla JavaScript in this section to create a SPA. We can use any other JavaScript framework, such as Angular, React, or Vue.js. In this implementation, we will be using the Azure AD B2C JavaScript SDK to log in to an application using Azure AD B2C. We can refer to the Azure AD B2C JavaScript SDK from Microsoft CDN using this URL: https://alcdn.msauth.net/browser/2.35.0/js/msal-browser.min.js. Since we are using vanilla JavaScript, we can include the JavaScript SDK using the URL in the script tag in HTML. We can follow these steps to create JavaScript SDK authentication using Azure AD B2C:
- First, we will create an empty ASP.NET web application – this...