# AzureAD/microsoft-authentication-library-for-js

Microsoft Authentication Library (MSAL) for JS

Repository: https://github.com/AzureAD/microsoft-authentication-library-for-js
Canonical: https://ross.abutalabs.com/products/microsoft-authentication-library-for-js
Homepage: http://aka.ms/aadv2
Language: TypeScript
License: MIT
License Family: permissive
Last push: 2026-08-26T22:58:01+00:00

## Health v2 (maintenance only)
Score: 95/100 (v2, computed 2026-09-03T02:39:23.370411+00:00)
- activity 99, release rhythm 86, longevity 100
- inputs: {"age_days": 3477, "days_push": 7, "days_rel": 15, "gap_med": 0, "n_releases_24m": 376}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4115, forks 2719 (observed 2026-08-28T04:08:35.793014+00:00)

## What it is
Microsoft Authentication Library (MSAL) for JavaScript enables client-side and server-side JS apps to authenticate users with Microsoft Entra ID, personal Microsoft accounts, and social identity providers via Azure AD B2C. It implements OAuth 2.0 and OpenID Connect flows and acquires tokens for accessing Microsoft Cloud services like Microsoft Graph.

## Use cases
- add microsoft sign-in to a react app
- authenticate users with azure ad in a node.js server
- get access tokens for microsoft graph api
- implement oauth2 authorization code flow with pkce in the browser
- support social login via azure ad b2c
- acquire tokens silently with refresh tokens
- implement device code login for cli apps

## When to choose
- your app needs Microsoft identity platform authentication (Entra ID, MSA, B2C)
- you want an official, OpenID-compliant OAuth2 library maintained by Microsoft
- you need token acquisition and caching for calling Microsoft Graph or other Microsoft Cloud APIs

## When to avoid
- you authenticate against non-Microsoft identity providers only (e.g., Auth0, Keycloak, generic OIDC)
- you need authentication for non-JavaScript platforms
- you want a lightweight generic OAuth library without Microsoft-specific integration

## Facets
- artifact type: library
- maturity: active
- function: auth, sdk, http-client
- domain: security, web-development, apis, developer-tools
- platform: browser, cross-platform
- tags: oauth2, openid-connect, microsoft-entra-id, azure-ad, pkce, token-acquisition, sso, b2c, nodejs, javascript, typescript

## Member repositories
- AzureAD/microsoft-authentication-library-for-js (main) score 95

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:35.793014+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:23:09.566615+00:00, confidence not recorded.
  - readme: https://github.com/AzureAD/microsoft-authentication-library-for-js (fetched 2026-08-28T04:08:35.793014+00:00, sha 7dbf9c5d4955)
- Data as of 2026-08-30T08:39:29.467469+00:00.
