auth-and-security-migration

Migrates ASP.NET MVC authentication and authorization to Node.js and React with Entra ID.

Updated Jul 23, 2026
One-click install
npx skills add https://github.com/samdop/convertonode --skill auth-and-security-migration-samdop
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: auth-and-security-migration
Source: https://github.com/samdop/convertonode/tree/main/.github/skills/auth-and-security-migration
Command: npx skills add https://github.com/samdop/convertonode --skill auth-and-security-migration-samdop

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires jose, passport, passport-azure-ad, @azure/msal-browser, @azure/msal-react, and includes references (resource) components.

What problem does it solve? Migrating authentication and authorization from ASP.NET MVC (Windows Auth, Forms Auth, ASP.NET Identity) to a Node.js API plus React frontend is error-prone, with risks like token audience mismatches, lost AD group mappings, and insecure cookie handling. This Skill provides decision matrices, templates, and checklists to move to Microsoft Entra ID, OIDC, and JWT safely. ## Core Features & Use Cases - Source-to-target decision matrix: Maps Windows Auth, Forms Auth, ASP.NET Identity, Basic Auth, and SAML to Entra ID, JWT bearer tokens, or BFF cookie sessions. - Ready-to-use templates: Includes MSAL React provider and route guards, framework-agnostic jose token validation middleware, a Passport passport-azure-ad strategy, and a PowerShell script that bootstraps Entra app registrations with GitHub Actions OIDC federated credentials. - Authorization mapping guidance: Converts [Authorize], [AllowAnonymous], and IsInRole checks into requireAuth, requireRole, and requireAnyRole middleware, with AD group-to-Entra group Object ID and App Roles strategies. - Use Case: When migrating an MVC app that uses [Authorize(Roles = "Admin")] and AD group checks, use this Skill to configure Entra app roles, wire MSAL into React, and enforce role claims in the Node API. ## Quick Start Ask the AI to migrate the ASP.NET MVC Windows Authentication and [Authorize] attributes in your controllers to Entra ID JWT validation in the Node.js API with MSAL sign-in in the React frontend.

Frequently Asked Questions about auth-and-security-migration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate ASP.NET MVC Windows Authentication to Node.js and React?

Replace IIS Windows Auth with Microsoft Entra ID using OIDC for sign-in and JWT bearer tokens for API calls. Verify AD syncs to Entra via Entra Connect, register web and API apps, then use MSAL in React and token validation middleware in Node.

How do I map [Authorize] attributes to Node.js middleware?

Map controller-level [Authorize] to a global requireAuth middleware, [Authorize(Roles = "Admin")] to requireRole('Admin'), and [AllowAnonymous] to routes without auth middleware. Policy-based attributes map to custom middleware factories.

Should I use Passport or jose for JWT validation in Node.js?

Use passport-azure-ad BearerStrategy when the project already uses Passport or NestJS with @nestjs/passport. Use jose with JWKS for Fastify, Hono, Express without Passport, or serverless functions where framework-neutral validation is preferred.

How do I migrate AD group authorization to Entra ID?

Sync groups with Entra Connect, configure the groups claim in the API app registration, and map group Object IDs to role names in API configuration. Prefer Entra App Roles for portable logic, and use Microsoft Graph lookups when tokens hit group overage limits.

Do bearer token APIs still need AntiForgeryToken CSRF protection?

No, bearer tokens sent in the Authorization header do not need AntiForgeryToken because browsers do not attach them automatically. CSRF protection is only required for cookie-based BFF sessions, where a double-submit cookie pattern is recommended.

How do I migrate ASP.NET Identity password hashes to Node.js?

Either bulk-import users into Entra External ID with forced password reset, or temporarily verify legacy PBKDF2 hashes on login and re-hash with bcrypt on first successful sign-in during a time-boxed migration window.