MSAL Library
MSAL stands for Microsoft Authentication Library
The Microsoft Authentication Library (MSAL) enables developers to acquire tokens from the Microsoft identity platform.
Once you have a token the user has been authenticated allowing them to access secured web APIs.
It can be used to provide secure access to Microsoft Graph, other Microsoft APIs, third-party web APIs, or your own web API
MSAL will cache the token for you, so you don't have to cache it in your application.
link - docs.microsoft.com/en-us/azure/active-directory/develop/msal-overview
link - developer.microsoft.com/en-us/identity/blogs/msal-js-2-0-supports-authorization-code-flow-is-now-generally-available/
MSAL - @azure/msal-browser
Released August 2020 and also referred to as MSAL v2.0.
Also known as Microsoft Identity Platform v2.0.
Work and School accounts and Personal accounts (Microsoft account) and Social accounts (Facebook, Google).
Uses OAuth 2.0 with PKCE (and does not support OAuth 2.0 Implicit Grant Flow).
PKCE is an acronym for Proof Key for Code Exchange and is pronounced "pixy".
import * as "msal_browser" from "msal-browser"
const msal_Instance = new msal_browser.PublicClientApplication
link - npmjs.com/package/@azure/msal-browser
link - docs.microsoft.com/en-us/azure/active-directory/develop/tutorial-v2-javascript-auth-code
Version | Release Date |
2.22.1 | 2022 March |
2.22.0 | 2022 February |
2.21.0 | 2022 January |
2.20.0 | 2021 December |
2.19.0 | 2021 November |
2.18.0 | 2021 October |
2.17.0 | 2021 September |
2.16.0 | 2021 August |
2.15.0 | 2021 July |
2.14.2 | 2021 May |
2.14.0 | 2021 April |
2.12.0 | 2021 March |
2.11.0 | 2021 February |
2.9.0 | 2021 January |
2.8.0 | 2020 December |
2.5.2 | 2020 November |
2.3.0 | 2020 October |
2.2.0 | 2020 September |
2.1.0 | 2020 August |
2.0.0 | 2020 July |
acquireTokenPopup | |
acquireTokenRedirect | |
acquireTokenSilent | The library first checks the cache in browser storage to see if a valid token exists and returns it. When no valid token is in the cache, it attempts to use its refresh token to get the token. If the refresh token's 24-hour lifetime has expired, MSAL.js will open a hidden iframe to silently request a new authorization code, which it will exchange for a new, valid refresh token. |
getAccountByUsername | |
getAllAccounts | |
loginPopup | |
loginRedirect | If you include your API scope in the request then a MS GRaph access token will be returned |
logout | |
logoutPopup |
MSAL - @azure/msal
Released May 2019 and also referred to as MSAL v1.0.
Work and School accounts and Personal accounts (Microsoft account) and Social accounts (Facebook, Google).
Uses OAuth 2.0 Implicit Flow.
This package is no longer being updated.
This is exactly the same package as the one below (msal).
The only difference between them, is the name/naming convention.
This package was released a year later than the "msal" package.
This package was not updated regularly because of the small number of downloads, compared to the "msal" package.
link - npmjs.com/package/@azure/msal
Version | Release Date |
1.4.5 | 2021 February |
1.3.1 | 2020 May |
1.3.0 | 2020 April |
1.2.0 | 2019 December |
1.1.0 | 2019 July |
1.0.0 | 2019 May |
0.2.0 | 2018 August |
MSAL - msal
Released May 2019 and also referred to as MSAL v1.0.
Work and School accounts and Personal accounts (Microsoft account) and Social accounts (Facebook, Google).
Uses OAuth 2.0 Implicit Flow.
This package is no longer being updated.
import * as "msal" from "msal"
const msal_Instance = new msal.UserAgentApplication
link - npmjs.com/package/msal
link - docs.microsoft.com/en-us/azure/active-directory/develop/migrate-spa-implicit-to-auth-code#switch-redirect-uris-to-spa-platform
link - docs.microsoft.com/en-us/azure/active-directory/develop/msal-compare-msal-js-and-adal-js
link - youtube.com/watch?v=CHzERullHe8
link - youtube.com/watch?v=kf_VMt_Eh0M
link - github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/v1-migration.md
Version | Release Date |
1.4.16 | 2022 February |
1.4.15 | 2021 November |
1.4.14 | 2021 October |
1.4.13 | 2021 August |
1.4.12 | 2021 July |
1.4.11 | 2021 May |
1.4.10 | 2021 April |
1.4.9 | 2021 March |
1.4.8 | 2021 March |
1.4.6 | 2021 February |
1.4.5 | 2021 February |
1.4.4 | 2020 November |
1.4.2 | 2020 October |
1.4.1 | 2020 September |
1.4.0 | 2020 August |
1.3.4 | 2020 August |
1.3.3 | 2020 July |
1.3.2 | 2020 July |
1.3.1 | 2020 June |
1.3.0 | 2020 April |
1.2.0 | 2019 December |
1.1.0 | 2019 July |
1.0.0 | 2019 May |
0.1.0 | 2017 May |
ADAL - adal-vanilla
Released January 2016 and also known as Microsoft Identity Platform v1.0.
The Azure Active Directory Authentication Library for JavaScript (ADAL) .
Work and School accounts (no personal or social accounts).
Uses OAuth 1.0 Implicit Flow.
This package is no longer being updated. The last update was in 2018.
link - npmjs.com/package/adal-vanilla
link - github.com/AzureAD/azure-activedirectory-library-for-js
link - docs.microsoft.com/en-us/azure/active-directory/develop/msal-migration
Other Links
link - github.com/AzureAD/microsoft-authentication-library-for-js/issues/1072
link - docs.microsoft.com/en-us/azure/active-directory/develop/msal-node-migration
link - docs.microsoft.com/en-us/azure/active-directory/develop/scenario-spa-app-registration
link - docs.microsoft.com/en-us/graph/tutorials/javascript
© 2022 Better Solutions Limited. All Rights Reserved. © 2022 Better Solutions Limited TopPrevNext