The Microsoft Authentication Library for JavaScript adds Auth to Javascript applications, and access to resource APIs in the Microsoft Cloud such as Microsoft Graph.
MSAL.js now supports Node.js and Electron!
MSAL.js supports both consumer and enterprise Microsoft accounts. This can be restricted if desired. Only applications that use special consumer or enterprise data will need to differentiate.
MSAL.js supports social identity providers like Facebook, Google, and LinkedIn through the Azure AD B2C service.
Follow the link that matches your app:
- Traditional web app
- Node.js app
- Or explore our samples
MSAL.js is a collection of Javascript related libraries providing common AuthN methods across several frameworks and application types. The lib
folder contains the source code for all of our libraries. You will also find all the details about installing the libraries, in their respective README.md.
-
Microsoft Authentication Library for Node.js v1.x (Alpha): A Node.js library that enables authentication and token acquisition with the Microsoft Identity platform in JavaScript applications. Implements the following OAuth 2.0 protocols and is OpenID-compliant:
- Authorization Code Grant with PKCE
- Device Code Grant
- Refresh Token Grant
- Client Credential Grant (Coming soon)
-
Microsoft Authentication Library for JavaScript v2.x: A browser-based, framework-agnostic browser library that enables authentication and token acquisition with the Microsoft Identity platform in JavaScript applications. Implements the OAuth 2.0 Authorization Code Flow with PKCE, and is OpenID-compliant.
-
Microsoft Authentication Library for JavaScript v1.x: A browser-based, framework-agnostic core library that enables authentication and token acquisition with the Microsoft Identity platform in JavaScript applications. Implements the OAuth 2.0 Implicit Grant Flow, and is OpenID-compliant.
-
Microsoft Authentication Library for Angular : A wrapper of the MSAL.js 1.x library for apps using Angular framework.
-
Microsoft Authentication Library for AngularJS : A wrapper of the MSAL.js 1.x library for apps using AngularJS framework.
We ship a number of different packages which are meant for different platforms. You can see the relationship between packages and different authentication flows they implement below.
The samples
folder contains sample applications for our libaries. A complete list of samples can be found in the respective package folders or on our wiki.
All of our libraries follow semantic versioning. We recommend using the latest version of each libary to ensure you have the latest security patches and bug fixes.
Please check the roadmap to see what we are working on and what we have planned for future releases.
-
GitHub Issues is the best place to ask questions, report bugs, and new request features.
-
FAQs for access to our frequently asked questions.
-
Stack Overflow using "msal" and "msal.js" tag.
-
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 the Microsoft Security Response Center (MSRC) 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").
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.