| type | skill |
| lifecycle | stable |
| inheritance | inheritable |
| name | msal-authentication |
| description | Microsoft Authentication Library (MSAL) patterns for React/SPA applications with Entra ID |
| tier | standard |
| applyTo | **/*msal*,**/*authentication* |
| currency | 2026-04-22T00:00:00.000Z |
| lastReviewed | 2026-04-30T00:00:00.000Z |
MSAL Authentication
Microsoft Authentication Library patterns for React/SPA applications with Microsoft Entra ID.
Staleness Watch: See EXTERNAL-API-REGISTRY.md for source URLs and recheck cadence
Version: 1.0.0
Core Concepts
Microsoft Authentication Library (MSAL) handles authentication with Microsoft Entra ID (formerly Azure Active Directory). It manages:
- Token acquisition and caching
- Silent token renewal
- Redirect/popup authentication flows
- Multi-tenant and B2B scenarios
Package Versions
{
"@azure/msal-browser": "^5.0.0",
"@azure/msal-react": "^3.0.0"
}
Configuration
Basic MSAL Configuration
import { Configuration, PublicClientApplication, LogLevel } from '@azure/msal-browser';
export const msalConfig: Configuration = {
auth: {
clientId: import.meta.env.VITE_ENTRA_CLIENT_ID,
authority: 'https://login.microsoftonline.com/common',
redirectUri: window.location.origin,
postLogoutRedirectUri: window..,
: ,
},
: {
: ,
: ,
},
: {
: {
: ... ? . : .,
},
},
};
msalInstance = (msalConfig);