Wednesday, 10 December 2025

what plugins used for aad authentication?

 

⭐ 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

PurposePackage
Use Azure AD (Microsoft Entra ID) authenticationMicrosoft.Identity.Web
JWT token validation for AADMicrosoft.IdentityModel.Tokens
OpenID Connect middlewareMicrosoft.AspNetCore.Authentication.OpenIdConnect
Add token acquisition for downstream APIsMicrosoft.Identity.Web.MicrosoftGraph

Typical Setup

builder.Services.AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme) .AddMicrosoftIdentityWebApp(builder.Configuration.GetSection("AzureAd"));

2. ASP.NET Core Web API (for JWT Authentication)

Plugins/Libraries

PurposePackage
AAD JWT validationMicrosoft.Identity.Web
Validate tokens manuallySystem.IdentityModel.Tokens.Jwt

Example

builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) .AddMicrosoftIdentityWebApi(builder.Configuration.GetSection("AzureAd"));

3. Azure Function App (.NET)

In-Process Functions

PackageUsage
Identity bindingMicrosoft.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:

PackageUsage
Microsoft.Identity.WebToken validation in isolated worker
Microsoft.IdentityModel.Protocols.OpenIdConnectOIDC metadata parsing

4. JavaScript / Node.js backend

NPM Packages

PurposePackage
OIDC login + Microsoft identity platform@azure/msal-node
Validate tokens in APIpassport-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

FrameworkPackage
Angular SPA@azure/msal-angular + @azure/msal-browser
React SPA@azure/msal-react
JS SPA@azure/msal-browser

6. Java (Spring Boot)

Maven Dependencies

PurposePackage
AAD starter for Springazure-spring-boot-starter-active-directory
OAuth2 Clientspring-security-oauth2-client
Resource server token validationspring-boot-starter-oauth2-resource-server


No comments:

Post a Comment

Recent Post

How to Determine User Story Complexity