
Microsoft
Run a local Microsoft Entra ID OAuth/OIDC emulator so you can test sign-in, token exchange, and Graph /me without Azure portal or live Microsoft APIs.
Install
npx skills add https://github.com/vercel-labs/emulate --skill microsoftWhat is this skill?
- Emulates Entra ID v2.0 with authorization code, PKCE, and client credentials flows
- Serves OIDC discovery and RS256-signed ID tokens on a configurable local port
- Exposes a Microsoft Graph-style /v1.0/me endpoint for profile assertions
- Start via npx emulate --service microsoft or createEmulator({ service: 'microsoft' })
- Maps real login.microsoftonline.com and graph.microsoft.com URLs to localhost for drop-in client config
Adoption & trust: 65 installs on skills.sh; 1.3k GitHub stars; 3/3 security scanners passed (skills.sh audits).
Recommended Skills
Journey fit
Auth wiring for Microsoft tenants happens during product build when you integrate OAuth clients, PKCE, and OIDC discovery—not at idea or launch copy stages. The skill is explicitly for configuring Azure AD-style OAuth clients, token exchange, and Microsoft Graph hooks—classic backend integration work.
Common Questions / FAQ
Is Microsoft safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
SKILL.md
READMESKILL.md - Microsoft
# Microsoft Entra ID Emulator Microsoft Entra ID (Azure AD) v2.0 OAuth 2.0 and OpenID Connect emulation with authorization code flow, PKCE, client credentials, RS256 ID tokens, OIDC discovery, and a Microsoft Graph `/v1.0/me` endpoint. ## Start ```bash # Microsoft only npx emulate --service microsoft # Default port (when run alone) # http://localhost:4000 ``` Or programmatically: ```typescript import { createEmulator } from 'emulate' const microsoft = await createEmulator({ service: 'microsoft', port: 4005 }) // microsoft.url === 'http://localhost:4005' ``` ## Pointing Your App at the Emulator ### Environment Variable ```bash MICROSOFT_EMULATOR_URL=http://localhost:4005 ``` ### OAuth URL Mapping | Real Microsoft URL | Emulator URL | |--------------------|-------------| | `https://login.microsoftonline.com/{tenant}/v2.0/.well-known/openid-configuration` | `$MICROSOFT_EMULATOR_URL/{tenant}/v2.0/.well-known/openid-configuration` | | `https://login.microsoftonline.com/.well-known/openid-configuration` | `$MICROSOFT_EMULATOR_URL/.well-known/openid-configuration` | | `https://login.microsoftonline.com/common/oauth2/v2.0/authorize` | `$MICROSOFT_EMULATOR_URL/oauth2/v2.0/authorize` | | `https://login.microsoftonline.com/common/oauth2/v2.0/token` | `$MICROSOFT_EMULATOR_URL/oauth2/v2.0/token` | | `https://login.microsoftonline.com/common/discovery/v2.0/keys` | `$MICROSOFT_EMULATOR_URL/discovery/v2.0/keys` | | `https://graph.microsoft.com/oidc/userinfo` | `$MICROSOFT_EMULATOR_URL/oidc/userinfo` | | `https://graph.microsoft.com/v1.0/me` | `$MICROSOFT_EMULATOR_URL/v1.0/me` | ### Auth.js / NextAuth.js ```typescript import MicrosoftEntraId from '@auth/core/providers/microsoft-entra-id' MicrosoftEntraId({ clientId: process.env.MICROSOFT_CLIENT_ID, clientSecret: process.env.MICROSOFT_CLIENT_SECRET, authorization: { url: `${process.env.MICROSOFT_EMULATOR_URL}/oauth2/v2.0/authorize`, params: { scope: 'openid email profile User.Read' }, }, token: { url: `${process.env.MICROSOFT_EMULATOR_URL}/oauth2/v2.0/token`, }, userinfo: { url: `${process.env.MICROSOFT_EMULATOR_URL}/oidc/userinfo`, }, issuer: process.env.MICROSOFT_EMULATOR_URL, }) ``` ### Passport.js ```typescript import { OIDCStrategy } from 'passport-azure-ad' const MICROSOFT_URL = process.env.MICROSOFT_EMULATOR_URL ?? 'https://login.microsoftonline.com' new OIDCStrategy({ identityMetadata: `${MICROSOFT_URL}/.well-known/openid-configuration`, clientID: process.env.MICROSOFT_CLIENT_ID, clientSecret: process.env.MICROSOFT_CLIENT_SECRET, redirectUrl: 'http://localhost:3000/api/auth/callback/microsoft-entra-id', responseType: 'code', responseMode: 'query', scope: ['openid', 'email', 'profile'], }, verifyCallback) ``` ### MSAL.js ```typescript import { ConfidentialClientApplication } from '@azure/msal-node' const msalConfig = { auth: { clientId: process.env.MICROSOFT_CLIENT_ID, clientSecret: process.env.MICROSOFT_CLIENT_SECRET, authority: process.env.MICROSOFT_EMULATOR_URL, knownAuthorities: [process.env.MICROSOFT_EMULATOR_URL], }, } const cca = new ConfidentialClientApplication(msalConfig) ``` ## Seed Config ```yaml microsoft: users: - email: testuser@outlook.com name: Test User given_name: Test