⭐ Summary (Quick List)
ASP.NET Core
Microsoft.Identity.Web
Microsoft.AspNetCore.Authentication.OpenIdConnect
Web API
Microsoft.Identity.Web
Azure Functions
Microsoft.Identity.Web (Isolated)
Angular / React
@azure/msal-angular
@azure/msal-react
@azure/msal-browser
Node.js
@azure/msal-node
Java
azure-spring-boot-starter-active-directory
1. ASP.NET Core (API / MVC / Razor / Blazor)
In ASP.NET Core, AAD authentication is implemented using middleware packages:
Primary NuGet Packages
| Purpose | Package |
|---|---|
| Use Azure AD (Microsoft Entra ID) authentication | Microsoft.Identity.Web |
| JWT token validation for AAD | Microsoft.IdentityModel.Tokens |
| OpenID Connect middleware | Microsoft.AspNetCore.Authentication.OpenIdConnect |
| Add token acquisition for downstream APIs | Microsoft.Identity.Web.MicrosoftGraph |
Typical Setup
✅ 2. ASP.NET Core Web API (for JWT Authentication)
Plugins/Libraries
| Purpose | Package |
|---|---|
| AAD JWT validation | Microsoft.Identity.Web |
| Validate tokens manually | System.IdentityModel.Tokens.Jwt |
Example
✅ 3. Azure Function App (.NET)
In-Process Functions
| Package | Usage |
|---|---|
| Identity binding | Microsoft.Azure.WebJobs.Extensions.AuthTokens (limited use) |
But generally, AAD authentication is configured via Function App → Authentication blade,
not inside code.
.NET Isolated Functions
Use standard ASP.NET Core authentication:
| Package | Usage |
|---|---|
| Microsoft.Identity.Web | Token validation in isolated worker |
| Microsoft.IdentityModel.Protocols.OpenIdConnect | OIDC metadata parsing |
✅ 4. JavaScript / Node.js backend
NPM Packages
| Purpose | Package |
|---|---|
| OIDC login + Microsoft identity platform | @azure/msal-node |
| Validate tokens in API | passport-azure-ad (deprecated) |
| Express middleware for token authentication | @azure/identity, jsonwebtoken |
The recommended package now is:
👉 @azure/msal-node
✅ 5. Angular / React / SPA Apps
NPM Packages
| Framework | Package |
|---|---|
| Angular SPA | @azure/msal-angular + @azure/msal-browser |
| React SPA | @azure/msal-react |
| JS SPA | @azure/msal-browser |
✅ 6. Java (Spring Boot)
Maven Dependencies
| Purpose | Package |
|---|---|
| AAD starter for Spring | azure-spring-boot-starter-active-directory |
| OAuth2 Client | spring-security-oauth2-client |
| Resource server token validation | spring-boot-starter-oauth2-resource-server |
No comments:
Post a Comment