Scenario: Single-page application
Learn all you need to build a single-page application (SPA).
Before reading this article, you should be familiar with the following concepts:
- Microsoft identity platform overview
- Authentication basics
- Application and service principals
- Permissions and consent
- ID tokens and access tokens
The Microsoft identity platform enables single-page applications to sign in users and get tokens to access back-end services or web APIs by using the OAuth 2.0 implicit flow. The implicit flow allows the application to get ID tokens to represent the authenticated user and also access tokens needed to call protected APIs.
To enable this scenario for your application, you need:
- Application registration with Azure Active Directory (Azure AD). This registration involves enabling the implicit flow and setting a redirect URI to which tokens are returned.
- Application configuration with the registered application properties, such as application ID.
- Using Microsoft Authentication Library (MSAL) to do the authentication flow to sign in and acquire tokens.