microsoft
Skill1.9k starsChanged 7 months agoApache-2.0View on GitHub
Emulated Microsoft Entra ID (Azure AD) OAuth 2.0 / OpenID Connect for local development and testing. Use when the user needs to test Microsoft sign-in locally, emulate Entra ID OIDC discovery, handle Microsoft token exchange, configure Azure AD OAuth clients, work with Microsoft Graph /me, or test PKCE/client credentials flows without hitting real Microsoft APIs. Triggers include "Microsoft OAuth", "Entra ID", "Azure AD", "emulate Microsoft", "mock Microsoft login", "test Microsoft sign-in", "Microsoft OIDC", "local Microsoft auth", or any task requiring a local Microsoft OAuth/OIDC provider.
- Reads credentials
- Sends data out
Trending
More talk lately.about the whole repository
Who's talking about vercel-labs/emulate
- @sungkim.bsky.social“emulate Local drop-in replacement services for CI and no-network sandboxes. Fully stateful, …”Bluesky · Mar 26, 2026 · 9 likes
- @topickapp.bsky.social“https://github.com/vercel-labs/emulate CIやネットワーク制限下で使える、ローカルAPIエミュレーター集です。 …”Bluesky · Apr 6, 2026 · 2 likes
- @tech-trending.bsky.social“GitHub - vercel-labs/emulate: Local API emulation for CI and no-network sandboxes …”Bluesky · Apr 5, 2026 · 2 likes
- MarcosCamara01/ecommerce-template“chore(deps): bump the development-minor-patch group across 1 directory with 8 updates”GitHub · Sep 21, 2026 · 1 reactions
- MarcosCamara01/ecommerce-template“chore(deps): bump the development-minor-patch group with 7 updates”GitHub · Sep 14, 2026 · 1 reactions
The biggest 5 of 54 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 54
Talked about on GitHub and Bluesky (54 times).
On GitHub · 48
- Sep 21, 2026chore(deps): bump the development-minor-patch group across 1 directory with 8 updates — MarcosCamara01/ecommerce-template1 reaction · 2 comments
- Sep 14, 2026chore(deps): bump the development-minor-patch group with 7 updates — MarcosCamara01/ecommerce-template1 reaction · 2 comments
- Sep 8, 2026chore(deps): bump the development-minor-patch group with 9 updates — MarcosCamara01/ecommerce-template1 reaction · 3 comments
- Oct 5, 2026chore(deps): bump the typescript-dependencies group across 9 directories with 8 updates — paradigmxyz/centaur0 reactions
- Oct 4, 2026agent-skills.github.vercel-labs.emulate: 0.11.2 → 0.12.1 — sudosubin/agents.nix0 reactions
43 more on GitHub
- Oct 3, 2026agent-skills.github.vercel-labs.emulate: init at 0.11.2 — sudosubin/agents.nix0 reactions
- Oct 3, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions · 1 comment
- Sep 30, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions · 1 comment
- Sep 28, 2026chore(deps): bump the typescript-dependencies group across 7 directories with 5 updates — paradigmxyz/centaur0 reactions
- Sep 28, 2026chore(deps): bump the development-minor-patch group with 10 updates — demo-nexoar/ecommerce0 reactions
- Sep 28, 2026chore(deps-dev): bump emulate from 0.11.2 to 0.12.0 — biw/scaleset0 reactions
- Sep 28, 2026chore(deps): bump the development-minor-patch group across 1 directory with 9 updates — MarcosCamara01/ecommerce-template0 reactions · 1 comment
- Sep 24, 2026@shared/email: make the Resend API base URL configurable for local emulation — englishstreetventures/osn0 reactions
- Sep 24, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions · 1 comment
- Sep 23, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions · 1 comment
- Sep 23, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions · 1 comment
- Sep 21, 2026deps: bump the dev group across 1 directory with 14 updates — pai-list/AxiomID0 reactions · 2 comments
- Sep 19, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions · 1 comment
- Sep 19, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions · 1 comment
- Sep 18, 2026chore(deps-dev): bump emulate from 0.9.0 to 0.11.2 — plenoai/metsuke0 reactions · 1 comment
- Sep 14, 2026deps: bump the dev group across 1 directory with 13 updates — pai-list/AxiomID0 reactions · 3 comments
- Sep 11, 2026chore(deps-dev): bump emulate from 0.9.0 to 0.11.1 — plenoai/metsuke0 reactions · 1 comment
- Sep 10, 2026chore(deps): bump the monthly-batch group with 32 updates — withAutograph/autograph-app-builder0 reactions · 1 comment
- Sep 3, 2026chore(deps): bump the minor-and-patch group across 1 directory with 7 updates — pleaseai/asana0 reactions · 4 comments
- Aug 31, 2026deps: bump the dev group across 1 directory with 13 updates — pai-list/AxiomID0 reactions · 3 comments
- Aug 27, 2026chore(deps): bump the minor-and-patch group across 1 directory with 6 updates — pleaseai/asana0 reactions · 5 comments
- Aug 26, 2026Complete Kimi K3 architecture review loop — dearlordylord/emulate0 reactions
- Aug 25, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions
- Aug 24, 2026deps: bump the dev group across 1 directory with 7 updates — pai-list/AxiomID0 reactions · 3 comments
- Aug 24, 2026chore(deps-dev): bump the dev-dependencies group across 1 directory with 20 updates — pleaseai/emulate0 reactions · 3 comments
- Aug 24, 2026chore(deps): bump the production-dependencies group across 1 directory with 3 updates — pleaseai/emulate0 reactions · 3 comments
- Aug 21, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions
- Aug 21, 2026chore(deps-dev): bump emulate from 0.9.0 to 0.10.0 — plenoai/metsuke0 reactions · 1 comment
- Aug 18, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions
- Aug 14, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions
- Jul 16, 2026📕 Vercel Emulate — recreate — BLamy/orly0 reactions · 2 comments
- Jul 4, 2026chore(deps)(deps-dev): bump @emulators/github from 0.8.0 to 0.9.0 — pai-list/AxiomID0 reactions · 4 comments
- Jul 3, 2026chore(deps-dev): bump emulate from 0.8.0 to 0.9.0 — plenoai/metsuke0 reactions
- Jun 29, 2026deps: bump the dev group with 5 updates — pai-list/AxiomID0 reactions · 2 comments
- Jun 26, 2026chore(deps-dev): bump emulate from 0.7.0 to 0.8.0 — plenoai/metsuke0 reactions · 2 comments
- Jun 23, 2026[book] Vercel Emulate — BLamy/orly0 reactions · 2 comments
- Jun 22, 2026deps: bump the dev group with 4 updates — pai-list/AxiomID0 reactions · 2 comments
- Jun 19, 2026chore(deps-dev): bump emulate from 0.6.1 to 0.7.0 — plenoai/metsuke0 reactions · 1 comment
- Jun 15, 2026chore(deps): bump the production-dependencies group across 1 directory with 2 updates — pleaseai/emulate0 reactions · 5 comments
- Jun 12, 2026chore(deps-dev): bump emulate from 0.6.0 to 0.6.1 — plenoai/metsuke0 reactions
- May 26, 2026chore(deps-dev): bump emulate from 0.4.1 to 0.6.0 — plenoai/metsuke0 reactions · 1 comment
- May 8, 2026Add example-stripe: subscription checkout with emulate + drizzle + vitest — remorses/spiceflow0 reactions · 1 comment
- Apr 21, 2026End-to-end testing for grammY bots via a Bot API emulator — grammyjs/grammYsays it tested it0 reactions · 6 comments
On Bluesky · 6
- Mar 26, 2026emulate Local drop-in replacement services for CI and no-network sandboxes. Fully stateful, production-fidelity API emulation. Not mocks.… — @sungkim.bsky.social9 likes and reposts
- Apr 6, 2026https://github.com/vercel-labs/emulate CIやネットワーク制限下で使える、ローカルAPIエミュレーター集です。 VercelやGitHub、Google、Slack、Apple、Microsoft、AWSを再現できます。… — @topickapp.bsky.social2 likes and reposts
- Apr 5, 2026GitHub - vercel-labs/emulate: Local API emulation for CI and no-network sandboxes https://github.com/vercel-labs/emulate — @tech-trending.bsky.social2 likes and reposts
- Apr 10, 2026github.com/vercel-labs/emulate GitHub - vercel-labs/emulate: Local API emulation for CI and no-network sandboxes — @technews4869.bsky.social1 likes and repost
- Apr 9, 2026サーバー側のレンダリングをエミュレートして検証できるVercelの開発用ツールっぽい 複雑な構成のデプロイ前に動作確認できて便利そう yug1224 starred vercel-labs/emulate… — @yug1224.com1 likes and repost
1 more on Bluesky
- Apr 5, 2026VercelやGitHub、Google、Slack、AWS(S3/SQS)などのAPIをローカルでエミュレートするツール。 CIやネットワークのないサンドボックス環境で、外部APIのモックサーバとして利用できる。 各サービスはステートフルにデータを保持し、OAuth… — @azu.bsky.social1 likes and repost
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 128
When no OAuth clients are configured, the emulator accepts any client_id.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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
Local listeners bind to 127.0.0.1 by default. For access from containers or other machines, pass --host 0.0.0.0 to the CLI or hostname: '0.0.0.0' to createEmulator. Configure --base-url or baseUrl for advertised URLs reachable by those clients.
# Microsoft only
npx emulate --service microsoft
# Default port (when run alone)
# http://localhost:4000Or programmatically:
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
MICROSOFT_EMULATOR_URL=http://localhost:4005OAuth 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
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
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
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
microsoft:
users:
- email: testuser@outlook.com
name: Test User
given_name: Test
family_name: User
tenant_id: 9188040d-6c67-4c5b-b112-36a304b66dad
oauth_clients:
- client_id: example-client-id
client_secret: example-client-secret
name: My Microsoft App
redirect_uris:
- http://localhost:3000/api/auth/callback/microsoft-entra-id
tenant_id: 9188040d-6c67-4c5b-b112-36a304b66dadWhen no OAuth clients are configured, the emulator accepts any client_id. With clients configured, strict validation is enforced for client_id, client_secret, and redirect_uri.
API Endpoints
OIDC Discovery
# Default tenant
curl http://localhost:4005/.well-known/openid-configuration
# Tenant-scoped (common, organizations, consumers, or specific tenant ID)
curl http://localhost:4005/common/v2.0/.well-known/openid-configurationReturns the standard OIDC discovery document:
{
"issuer": "http://localhost:4005/{tenant}/v2.0",
"authorization_endpoint": "http://localhost:4005/oauth2/v2.0/authorize",
"token_endpoint": "http://localhost:4005/oauth2/v2.0/token",
"userinfo_endpoint": "http://localhost:4005/oidc/userinfo",
"end_session_endpoint": "http://localhost:4005/oauth2/v2.0/logout",
"jwks_uri": "http://localhost:4005/discovery/v2.0/keys",
"response_types_supported": ["code"],
"subject_types_supported": ["pairwise"],
"id_token_signing_alg_values_supported": ["RS256"],
"scopes_supported": ["openid", "email", "profile", "User.Read", "offline_access"],
"token_endpoint_auth_methods_supported": ["client_secret_post", "client_secret_basic"]
}JWKS
curl http://localhost:4005/discovery/v2.0/keysReturns an RSA public key (kid: emulate-microsoft-1) for verifying id_token signatures.
Authorization
# Browser flow: redirects to a user picker page
curl -v "http://localhost:4005/oauth2/v2.0/authorize?\
client_id=example-client-id&\
redirect_uri=http://localhost:3000/api/auth/callback/microsoft-entra-id&\
scope=openid+email+profile&\
response_type=code&\
state=random-state&\
nonce=random-nonce"Query parameters:
| Param | Description |
client_id | OAuth client ID |
redirect_uri | Callback URL |
scope | Space-separated scopes (openid email profile User.Read) |
state | Opaque state for CSRF protection |
nonce | Nonce for ID token (optional) |
response_mode | query (default) or form_post |
code_challenge | PKCE challenge (optional) |
code_challenge_method | plain or S256 (optional) |
Token Exchange
curl -X POST http://localhost:4005/oauth2/v2.0/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "code=<authorization_code>&\
client_id=example-client-id&\
client_secret=example-client-secret&\
redirect_uri=http://localhost:3000/api/auth/callback/microsoft-entra-id&\
grant_type=authorization_code"Returns:
{
"access_token": "microsoft_...",
"refresh_token": "r_microsoft_...",
"id_token": "<jwt>",
"token_type": "Bearer",
"expires_in": 3600,
"scope": "openid email profile"
}The id_token is an RS256 JWT containing sub, oid, tid (tenant ID), email, name, preferred_username, ver ("2.0"), and optional nonce.
For PKCE, include code_verifier in the token request.
Supports Authorization: Basic header with base64-encoded client_id:client_secret as an alternative to body parameters.
Client Credentials
curl -X POST http://localhost:4005/oauth2/v2.0/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "client_id=example-client-id&\
client_secret=example-client-secret&\
grant_type=client_credentials&\
scope=https://graph.microsoft.com/.default"Returns an access_token only (no refresh_token or id_token).
Refresh Token
curl -X POST http://localhost:4005/oauth2/v2.0/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "refresh_token=r_microsoft_...&\
client_id=example-client-id&\
client_secret=example-client-secret&\
grant_type=refresh_token"Returns a new access_token, rotated refresh_token, and new id_token. The presenting client_id and client_secret must belong to the client that received the refresh token. Legacy refresh records without a stored client binding remain supported.
User Info
curl http://localhost:4005/oidc/userinfo \
-H "Authorization: Bearer microsoft_..."Returns:
{
"sub": "<oid>",
"email": "testuser@outlook.com",
"name": "Test User",
"given_name": "Test",
"family_name": "User",
"preferred_username": "testuser@outlook.com"
}Microsoft Graph /me
curl http://localhost:4005/v1.0/me \
-H "Authorization: Bearer microsoft_..."Returns an OData-style response:
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users/$entity",
"displayName": "Test User",
"mail": "testuser@outlook.com",
"userPrincipalName": "testuser@outlook.com",
"id": "<oid>"
}Logout
curl "http://localhost:4005/oauth2/v2.0/logout?post_logout_redirect_uri=http://localhost:3000"Redirects to the post_logout_redirect_uri if provided and valid.
Token Revocation
curl -X POST http://localhost:4005/oauth2/v2.0/revoke \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "token=microsoft_..."Returns 200 OK. The token is removed from the emulator's token map.
Common Patterns
Full Authorization Code Flow
MICROSOFT_URL="http://localhost:4005"
CLIENT_ID="example-client-id"
CLIENT_SECRET="example-client-secret"
REDIRECT_URI="http://localhost:3000/api/auth/callback/microsoft-entra-id"
# 1. Open in browser (user picks a seeded account)
# $MICROSOFT_URL/oauth2/v2.0/authorize?client_id=$CLIENT_ID&redirect_uri=$REDIRECT_URI&scope=openid+email+profile&response_type=code&state=abc
# 2. After user selection, emulator redirects to:
# $REDIRECT_URI?code=<code>&state=abc
# 3. Exchange code for tokens
curl -X POST $MICROSOFT_URL/oauth2/v2.0/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "code=<code>&client_id=$CLIENT_ID&client_secret=$CLIENT_SECRET&redirect_uri=$REDIRECT_URI&grant_type=authorization_code"
# 4. Fetch user info with the access_token
curl $MICROSOFT_URL/oidc/userinfo \
-H "Authorization: Bearer <access_token>"PKCE Flow
CODE_VERIFIER=$(openssl rand -base64 32 | tr -d '=+/' | cut -c1-43)
CODE_CHALLENGE=$(echo -n $CODE_VERIFIER | openssl dgst -sha256 -binary | base64 | tr -d '=' | tr '+/' '-_')
# 1. Authorize with challenge
# $MICROSOFT_URL/oauth2/v2.0/authorize?...&code_challenge=$CODE_CHALLENGE&code_challenge_method=S256
# 2. Token exchange with verifier
curl -X POST $MICROSOFT_URL/oauth2/v2.0/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "code=<code>&client_id=$CLIENT_ID&client_secret=$CLIENT_SECRET&redirect_uri=$REDIRECT_URI&grant_type=authorization_code&code_verifier=$CODE_VERIFIER"OIDC Discovery-Based Setup
Libraries that support OIDC discovery can auto-configure from the discovery document:
import { Issuer } from 'openid-client'
const microsoftIssuer = await Issuer.discover(
process.env.MICROSOFT_EMULATOR_URL ?? 'https://login.microsoftonline.com/common/v2.0'
)
const client = new microsoftIssuer.Client({
client_id: process.env.MICROSOFT_CLIENT_ID,
client_secret: process.env.MICROSOFT_CLIENT_SECRET,
redirect_uris: ['http://localhost:3000/api/auth/callback/microsoft-entra-id'],
})Custom emulators alongside built-ins
Use npx emulate init --custom inventory to scaffold a third-party API emulator and test. Register it in emulate.config.ts with defineConfig from emulate, alongside built-in entries such as { emulator: "microsoft" }. Run npx emulate start --watch to reload imports and inspect custom state at the printed /_emulate URL. Successful reloads reset the run to seed. Existing flat seed configs still work; --config selects an explicit file. For authoring and testing third-party API emulators, see https://emulate.dev/docs/custom-emulators.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

