Microsoft Authentication Library for Angular
|Getting Started||AAD Docs||Library Reference||Support||Samples|
- Version Support
- Build and running tests
- Community Help and Support
- Security Reporting
- Code of Conduct
MSAL for Angular enables Angular web applications to authenticate users using Azure AD work and school accounts (AAD), Microsoft personal accounts (MSA) and social identity providers like Facebook, Google, LinkedIn, Microsoft accounts, etc. through Azure AD B2C service. It also enables your app to get tokens to access Microsoft Cloud services such as Microsoft Graph.
@azure/msal-angular package described by the code in this folder wraps the
@azure/msal-browser package and uses it as a peer dependency to enable authentication in Angular Web Applications without backend servers. This version of the library uses the OAuth 2.0 Authorization Code Flow with PKCE. To read more about this protocol, as well as the differences between implicit flow and authorization code flow, see the description provided by @azure/msal-browser. If you are looking for the version of the library that uses the implicit flow, please see the MSAL Angular v1 library.
@azure/msal-angular library improves upon the previous version and utilizes the authorization code flow. Most features available in the old library will be available in this one, but there are nuances to the authentication flow in both. The latest
@azure/msal-angular package does NOT support the implicit flow.
At a minimum,
@azure/msal-angular will follow the support schedule of the main Angular project. We may continue to support certain versions of Angular that are not under Active or LTS support from the main Angular project on a version-by-version basis, as defined below.
|MSAL Angular version||MSAL support status||Supported Angular versions|
|MSAL Angular v2||Active development||9, 10, 11, 12|
|MSAL Angular v1||Active development||6, 7, 8, 9|
|MSAL Angular v0||In maintenance||4, 5|
@azure/msal-angular, register an application in Azure AD to get your
@azure/msal-angular package is available on NPM:
npm install @azure/msal-browser @azure/msal-angular@latest
MSAL Angular Basics
- Public APIs
- Using redirects
- Using the MsalGuard
- Using the MsalInterceptor
- Known issues
- Internet Explorer Support
- Angular Universal and SSR
All documentation for MSAL Angular v1 can be found here.
MSAL Angular v1 Samples
MSAL Angular v2 Samples
See here for specific features demonstrated by our MSAL Angular v2 samples.
Advanced MSAL Angular v2 Samples
- Angular SPA with ASP.NET Core web API
- Angular SPA with APS.NET Core web API using App Roles and RBAC
- Angular SPA calling Microsoft Graph via ASP.NET Core web API using on-behalf-of flow
- Angular SPA calling ASP.NET Core Web API using Proof of Possession tokens
- Multi-tenant tutorial using MSAL Angular v2
- Deployment tutorial using Azure App Service and Azure Storage
Build and running tests
If you want to build the library and run all the unit tests, you can do the following.
First navigate to the root directory of the library(msal-angular) and install the dependencies:
Then use the following command to build the library and run all the unit tests:
npm run build npm run test
This library controls how users sign-in and access services. We recommend you always take the latest version of our library in your app when possible. We use semantic versioning so you can control the risk associated with updating your app. As an example, always downloading the latest minor version number (e.g. x.y.x) ensures you get the latest security and feature enhanements but our API surface remains the same. You can always see the latest version and release notes under the Releases tab of GitHub.
Community Help and Support
- Msal Browser FAQ for access to our frequently asked questions
- Stack Overflow using tag "msal". We highly recommend you ask your questions on Stack Overflow first and browse existing issues to see if someone has asked your question before.
- GitHub Issues for reporting a bug or feature requests
- User Voice page to provide recommendations and/or feedback
We enthusiastically welcome contributions and feedback. Please read the contributing guide before you begin.
If you find a security issue with our libraries or services please report it to email@example.com with as much detail as possible. Your submission may be eligible for a bounty through the Microsoft Bounty program. Please do not post security issues to GitHub Issues or any other public site. We will contact you shortly upon receiving the information. We encourage you to get notifications of when security incidents occur by visiting this page and subscribing to Security Advisory Alerts.
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License (the "License").