/descope-skills:azure-ad-b2c-to-descopefrom descope-skills
Guides migration from Azure AD B2C to Descope with a structured plan covering feature mapping, SDK migration, and execution. Use when evaluating or performing a B2C-to-Descope move.
Ships in descope-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
This skill guides self-service migrations from Azure AD B2C to Descope, in order:
MIGRATION-PLAN.md for the user to reviewMIGRATION-SUMMARY.mdDon't collapse or skip parts. The plan is reviewed before any code changes.
Rule of this skill: SKILL.md holds the workflow, decisions and short rules; details, tables and
code live in the references and are linked as file.md → Section.
References (in this skill's directory):
references/implementation-nuances.md — B2C → Descope feature mapping, token gotchas, framework sections (MSAL React, Angular, Next.js, Vue, plain JS, server-side web apps), user migration, enterprise SSO migrationreferences/flows-and-widgets.md — B2C → Descope lingo, Flow structure and templates, Widgets, SSO Setup Suite, Console-vs-code decision guidereferences/backend-sdks.md — backend migration patterns: .NET (Microsoft.Identity.Web), Node.js, Python, Javareferences/b2c-detection-patterns.md — code search patterns, read-only Microsoft Graph discovery of the B2C tenant, out-of-scope detection, evidence templateConsole-first. Before recommending SDK code for any user-facing auth feature, check whether
the Console, a Flow, or a Widget covers the use case. B2C teams configure auth through user flows
in the Azure portal or custom policy XML (Identity Experience Framework). Descope Flows replace
both — visually, without XML or policy uploads. Engineers integrate once (SDK setup + token
validation). Later auth changes — new methods, MFA changes, branding — happen in the Console.
See references/flows-and-widgets.md → Console vs. Code.
Match first, then enhance. Rebuild what B2C does today 1:1 — same sign-in methods, same
screens, same tenants and roles — so every test has one question: does the app behave the same as
before? Passkeys, adaptive MFA, or a redesigned login are post-cutover improvements: list them in
MIGRATION-SUMMARY.md, don't build them into the migration. See
docs.descope.com/migrate/strategy.
One app at a time, tests first. Get automated sign-in tests running through Descope before moving any app, then move apps one at a time. A per-app cutover keeps each change small and each failure easy to trace.
Ask, don't assume. At every design decision — login mode, which Descope app type, password
strategy, where roles come from, SSO cutover — use AskUserQuestion rather than proceeding with
an assumption. A wrong assumption compounds across 20+ files.
MCP over memory. When a Descope MCP is connected (confirmed in Part 1), use
docs_ask_question (Descope MCP Server) or ask-question-about-descope (Docs MCP) to verify
every SDK method name, option shape, and return type before writing it. Do not write a method name and add a hedge like "verify the exact name" —
verify it.
B2C configuration often lives outside the repo. User flows, custom policies, identity
providers, API connectors, and app registrations live in the Azure portal. Read them from the
tenant (read-only Microsoft Graph, see references/b2c-detection-patterns.md) or ask the user
for the custom policy XML files. Do not infer the auth experience from code alone.
implementation-nuances.md → MSAL POC
first, then replace MSAL).implementation-nuances.md → Secrets can't be exported).oid. Follow
implementation-nuances.md → User ID strategy.implementation-nuances.md → Enterprise SSO users).scp, tfp, or emails from Descope tokens. Map each claim (see Execution Phase 4d:
Critical Gotchas). oid is the exception: keep the claim name when the JWT Template emits it.aud validation for Inbound App tokens. Validate against the Resource identifier, not the project ID.DESCOPE_MANAGEMENT_KEY or Inbound App client secrets client-side.First run Part 1.5's quick grep (no questions). If it already says stop, stop there without asking about the MCP. Otherwise check which Descope MCP is connected:
docs_search with a simple query (e.g., "session validation").
It searches the docs and can also read and change the Descope project.search-descope-docs.If the Descope MCP Server is connected: proceed to Part 1.5.
If it isn't, show this message and use AskUserQuestion:
Connect the Descope MCP Server. This skill uses it to check current SDK methods and features, and it can read your Descope project and make management changes to it with your approval. Without it, guidance may be stale. Server URL
https://mcp.descope.com(other regions and client setup: https://docs.descope.com/mcp/mcp-server).Connect it before we continue, or proceed without it?
docs_search, then
search-descope-docs if that fails. If only the Docs MCP responds, continue as "Proceed with
only the Docs MCP" below.Do not proceed to Part 1.5 until this step is resolved.
Before triage, confirm the app uses Azure AD B2C. Quick check (case-insensitive): grep for
b2clogin.com, B2C_1, /tfp/, AzureAdB2C, WithB2CAuthority.
| What the repo shows | Result |
|---|---|
Any of the markers above — on any host, including a custom domain (login.<company>.com/<tenant>.onmicrosoft.com/B2C_1A_…) | Azure AD B2C — proceed |
*.ciamlogin.com (Entra External ID), or login.microsoftonline.com/<tenant> with no B2C policy (workforce Entra ID) | Stop: this skill does not cover it |
| Another identity provider (IdentityServer / Duende, Auth0, Okta, Keycloak, Cognito, PingOne, a homegrown OIDC server), including a generic OIDC library pointed at a non-Microsoft host | Stop and name the matching skill if one exists (auth0-to-descope, okta-cis-to-descope, pingone-to-descope, stytch-to-descope, workos-to-descope); otherwise point to docs.descope.com/migrate |
| No identity provider visible — authority in Key Vault, app settings or a pipeline | Ask |
When asking, use AskUserQuestion: "Which service does this app sign in with?" — Azure AD B2C /
Microsoft Entra External ID / Microsoft Entra ID (workforce) / Other (name it). Proceed only on an
explicit "Azure AD B2C". See references/b2c-detection-patterns.md → Out-of-Scope Detection.
The code wins over the request: if the user says "B2C" but the repo shows another provider, ask.
When stopping, say what you found and where to go:
This skill covers Azure AD B2C only. This app signs in with (
<file>:<line>). <Use the<skill-name>skill | See docs.descope.com/migrate>. No code was changed.
Part 2 has these sub-steps:
MIGRATION-PLAN.md — write it and pause for reviewAskUserQuestion)Use the AskUserQuestion tool to gather the information below. Do not infer answers from
memory, prior conversations, or assumptions — even if you think you know.
Do not proceed to Step 0.5 until the user has answered.
Decision 0 — How users log in today (resolve this first):
"How does the app send users to B2C today? (a) MSAL redirect or popup to the B2C-hosted page (
loginRedirect,loginPopup,MsalProvider,b2clogin.com), (b) a server-side web app using OpenID Connect middleware (Microsoft.Identity.Web,passport-azure-ad,msal-node), (c) B2C embedded sign-in in an iframe (custom policy withJourneyFraming), or (d) a native/mobile app that collects the password itself (ROPC)?"
Decision tree:
Login mode today?
├── (a) MSAL redirect/popup (SPA) → Descope-hosted login: Descope SDK with oidcConfig
│ (per-SDK notes: implementation-nuances.md → Hosted login by default)
│ Customer asks for in-page login → Embedded <Descope flowId="..."/> instead
├── (b) Server-side web app (OIDC middleware) → Standard OIDC library pointed at Descope
│ (.NET OpenIdConnect, openid-client, Authlib, Spring)
├── (c) B2C iframe embedded sign-in → Embedded <Descope flowId="..."/> (customer chose in-page login)
└── (d) ROPC native app → Descope native SDK / native Flows (MFA and passkeys
can follow after cutover)
loginPopup / acquireTokenPopup users move to the redirect: Descope-hosted login is
redirect-based.
An app can match two branches (a server-side msal-node app that also renders sign-in in an
iframe). The target decides: if sign-in must stay in the page, follow (c) for the login and
use (b) only for what the server keeps doing (validating the session on each request); otherwise
follow (b).
POC with the app's current library first — offer it whenever the target is redirect login. If the app uses MSAL or another OIDC client (search group 1) and the target is Descope-hosted login (Decision 0 (a) or (b)), ask:
"Do you want to start with a proof of concept that keeps your current sign-in library and only changes its configuration to point at Descope? Then we replace or keep it."
If yes, the plan runs the POC first, before any rewrite (implementation-nuances.md → MSAL POC
first, then replace MSAL, and → Other OIDC libraries). What follows the POC depends on the library:
MSAL is always replaced with the Descope SDK before production; a standard OIDC library can stay.
Skip the POC, and say why in the plan, for Microsoft.Identity.Web, native MSAL, and when the
target is an embedded Flow (Decision 0 (c)) — the POC would test a login that never ships.
Rule of thumb: Descope-hosted login by default — B2C users already redirect to
b2clogin.com, so a hosted page is the smallest UX change. Use an embedded Flow only for B2C
iframe users or when the customer asks for it.
Decision 1 — Which Descope app the login goes through:
"Does the app's frontend call its own API with B2C access tokens (it requests a scope like
https://<tenant>.onmicrosoft.com/api/tasks.readand the API checksscp/[RequiredScope])? Are there other callers — partner apps, scripts, background services using client credentials, AI agents?"
Decision tree:
Who calls the API?
├── Own frontend with B2C scopes (most B2C apps with a backend)
│ → Inbound App for the frontend + Descope Resource for the API
│ Recreate the same scope names on the Resource; backend scope checks stay scope checks
│ (only the claim name changes: scp → scope)
├── Also partners / agents / CLIs
│ → One additional Inbound App per caller (consent + scoped tokens)
├── Client-credentials (M2M) apps
│ → Confidential Inbound App with client credentials (not Access Keys)
└── No API, or API only checks "signed in"
→ Federated App (standard OIDC library) or plain Descope SDK session
Inbound App rules (details: implementation-nuances.md → Which Descope app):
No consent screen for first-party users: Update User Consent with Scopes auto approval (→ Consent for first-party Inbound Apps).
Take the issuer from a real token — never construct it or copy it from the settings page (→ Finding the Inbound App issuer).
Send the Resource on both requests: loginWithRedirect({ resource, extraTokenParams: { resource } })
(→ Selecting the Resource).
An embedded Flow issues a session token (no scope) and can't mint Inbound App access tokens —
keep hosted login for scoped APIs (→ Embedded Flows and scoped APIs).
Connect the Inbound App to the Resource with an access policy. Creating both doesn't link them. On the Access Policy page, add a rule:
If the policy is missing or a scope isn't ticked, sign-in still works, but the access token lacks those scopes, and the API rejects the calls that need them (403).
Decision 2 — What "tenant" means in their B2C setup:
Customers use "tenant" for two different things. Ask, don't assume:
"When you say 'tenant', which do you mean? (a) separate B2C directories — one per environment, brand, or region (
contoso-dev.onmicrosoft.com,contoso-eu.onmicrosoft.com), (b) one B2C directory where customer organizations are separated inside your custom policies (per-customer identity providers,domain_hint, a tenant or organization claim, an API connector lookup), (c) both, (d) no customer separation, or (e) a separate B2C directory for each business customer (one for Acme, one for Globex)?"
Decision tree:
What is a "tenant"?
├── (a) Separate B2C directories → One Descope project per directory, each in the
│ directory's region (Step 0.5 → Deployment)
├── (b) Customer orgs inside custom policies → Descope tenants in one project
│ Record how the policy identifies the org today
│ (domain_hint, claim, lookup) — the Flow does the same
│ with email-domain routing, a tenant slug or
│ ID, or tenant selection
├── (c) Both → Projects per directory, tenants inside each
├── (d) No separation → One project, no tenants
└── (e) A directory per business customer → Ask why (below). Default: one project,
one tenant per directory
A directory per business customer (e). Customers usually split directories because B2C has no organizations, not because they need separate projects. Ask why, then recommend:
tenant Flow input or SDK option).
How the user import handles isolated users isn't documented — confirm in a dev import.Consolidating means importing each directory's users into its tenant. Without Tenant User
Isolation, list emails that appear in more than one directory as conflicts and decide each with the
customer before import: a merge keeps one password, profile and azureObjectId, and enterprise SSO
users stay in one tenant (DO NOT list). Each customer is routed to its tenant the way the app picks
the directory today, for example subdomain → tenant slug (implementation-nuances.md → Picking the
tenant at sign-in).
Dev / staging / prod directories are case (a) even when the customer doesn't call them tenants.
Each B2C app registration then maps to one Descope app by platform type
(b2c-detection-patterns.md → App registration type → Descope app).
Do not proceed until all three decisions are resolved.
Remaining triage — first AskUserQuestion call (up to 4 questions):
B2C_1_…), custom policies (B2C_1A_…, Identity Experience Framework), Conditional Access policies, or a mix? Discovery reads every place they name. Can they share the custom policy XML files, or grant read-only Graph access to the tenant?Second AskUserQuestion call — B2C features in use. Four multiSelect: true questions with
four options each (the tool allows at most four options per question):
| Question | Options |
|---|---|
| Journeys and identity | Custom policies with REST technical profiles / API connectors · Social IdPs (Google, Facebook, Apple, Microsoft) · Enterprise IdPs (customer Entra ID, SAML, multi-tenant common) · MFA or Conditional Access |
| Users and data | Custom attributes (extension_*) · Roles or groups in tokens · Passkeys via Microsoft's sample or a partner · Invitations or custom verification / reset emails |
| Hosting and UX | Custom page layouts · Custom domain (Azure Front Door) · Non-default languages (ui_locales) · Embedded iframe sign-in or ROPC |
| Apps and security | Client-credentials (M2M) apps · B2C issuing SAML to the customer's apps · An app-launcher portal (Azure My Apps or custom) · Fraud controls (risk policies, CAPTCHA, fraud vendors, phone country limits, smart lockout) |
Follow up on anything selected. After both calls, summarize findings and flag high-complexity items (custom policies with many REST technical profiles, many enterprise IdPs, roles built via API connectors) before Step 0.5.
AskUserQuestion)Ask even the ones you think you know. Batch into calls of up to 4 questions. Skip clearly inapplicable ones.
Policies and journeys
p= parameter), or does one policy branch internally on its inputs (domain_hint,
client ID, a query parameter, a claim from an API connector)?tfp / acr after login and act on it (for example "came back from
profile edit", "came back from password reset")?Decision tree:
How is the journey chosen?
├── App picks the policy → One Flow per journey
│ Sign-up / sign-in (+ password reset) → One login Flow. Hosted login runs the Flow set in
│ that app's Flow Hosting settings (one per app);
│ embedded login sets the flowId prop
│ Profile edit, change MFA, etc. → User Profile Widget or an embedded Flow in the app,
│ not a second hosted login (server-rendered apps:
│ implementation-nuances.md → Server-side web apps)
├── One policy branches on inputs → One Flow with conditions on the same inputs
│ (form fields, query params, connector results)
└── Both → Map each policy separately using the two rules above
App code reads tfp / acr?
├── Only to handle AADB2C90118 / B2C redirects → Delete it; Descope returns from the Flow directly
└── Real branching on which journey ran → Add a claim in each Flow with the Custom Claims
action and read that claim instead
Apps (skip if Step 1b will read app registrations through Graph)
.default) on the API.Identity and data
oid, sub, or both?
Which strategy: keep the B2C ID, switch to the Descope user ID, or remap on first
login (implementation-nuances.md → User ID strategy)?implementation-nuances.md → Roles and groups)extension_CompanyId), or customer IdPs
represent customer organizations? (They become Descope tenants; discovery checks both groups and
attributes either way — b2c-detection-patterns.md → Customer organization discovery.)Enterprise SSO (if enterprise IdPs are in use)
b2clogin.com?amr contains mfa)?Passwords and sessions (if existing users)
implementation-nuances.md → Session behavior and token lifetimes)Deployment
implementation-nuances.md → Custom domain on Azure Front Door)auth.<company>.com), separate from the hostname B2C uses today? The two-stage cutover needs it.Gaps to flag immediately (don't ask — flag based on answers)
b2clogin.com URLs, OIDC secrets, SAML signing keys
(implementation-nuances.md → Per-connection inventory and cutover rules).Console/Flow/Widget opportunities (flag, then ask)
Summarize blockers and opportunities before discovery.
Fast-track — SPA with hosted login, no custom policy logic (all must be true):
If all are true, the work is mostly Console setup (Flow, Inbound App + Resource or Federated App, JWT Template) plus an SDK swap in one frontend and one backend. Keep the codebase analysis short. Otherwise run full discovery.
Read references/b2c-detection-patterns.md before this step.
Step 1a — Code analysis. Run the search groups in b2c-detection-patterns.md → Search Groups
(MSAL packages, authority/policy names, MSAL call sites, B2C-specific logic, token claims, roles,
domain_hint, iframe sign-in, custom policy XML, user IDs used as keys or parsed as GUIDs). Record each
hit as the search groups describe.
Step 1b — Tenant discovery (optional, read-only). If the user granted read-only Graph access,
run the routes in b2c-detection-patterns.md → Read-Only Microsoft Graph Discovery: user flows,
custom policies (download XML), identity providers, API connectors, app registrations, custom
attributes, Conditional Access policies, user counts. If not, ask for the custom policy XML
files, a list of identity providers, and each Conditional Access policy's conditions and grant
(require MFA / block). Without Graph access the user export is a blocking dependency: name in
the plan who will run it, or choose a JIT-only path (implementation-nuances.md → Exporting users
from B2C → Without Graph access).
Also build, from the same sources:
b2c-detection-patterns.md → Sign-in method
inventory).AskUserQuestion
(b2c-detection-patterns.md → Customer organization discovery). Without Graph access, run
search group 14 and ask for the group list and attribute names.b2c-detection-patterns.md → Tenants with
only user flows).implementation-nuances.md → Policy key inventory).b2c-detection-patterns.md → Custom Policy XML Hints).Step 1c — Enterprise SSO inventory (required if enterprise IdPs are in use). One row per
customer connection (b2c-detection-patterns.md → Evidence Recording Template), with a cutover
result from implementation-nuances.md → Per-connection inventory and cutover rules.
If a Descope MCP is connected, verify SDK method names you plan to reference.
Write MIGRATION-PLAN.md to the working directory. Two audiences: the engineer needs enough
detail to execute; the PM or tech lead needs scope, risk, and timeline without jargon. Use plain
English, explain terms on first use, open each section with a one-sentence summary, say what
breaks if a risk is missed, pair complexity with time estimates.
Sections, in this order:
2–3 sentences: what's replaced, what replaces it, the recommended approach. Then:
| Login | Descope-hosted (via Inbound App / Federated App) / Embedded Flow |
| API authorization | Inbound App + Resource (scopes kept) / Session token only |
| Files changing | N files across N areas |
| Console setup | N steps |
| User impact | Re-login once / password reset / no change |
| Enterprise customers affected | N of N customer IdP admins must act (from Step 1c) |
| Estimated effort | N–N hours |
| Biggest risk | One sentence |
Prose: today B2C hosts login via user flows / custom policies, issues ID + access tokens per
policy, and validates them through Microsoft.Identity.Web / MSAL; after migration Descope does
each of these. List B2C features in use in plain English.
Group by area (frontend login, token acquisition, backend validation, claims, roles, config). Table per group: File | What it does today | What changes. End with total and effort.
One row per user flow / custom policy from Step 0.5:
| B2C policy | Called by (apps) | Scope (app / customer / shared) | How the journey is chosen | Descope Flow ID | Notes (branches, tfp/acr consumers) |
|---|
One row per method from the Step 1b inventory:
| Method | Defined in (tenant list / policy XML) | Offered by (policies) | Descope equivalent | Credential to re-obtain |
|---|
Keyset (B2C_1A_…) | Used by (policy / technical profile) | Purpose | Expires | Descope action | Who provides the credential |
|---|
One table each, built in Step 1; the reference section names the columns:
implementation-nuances.md → Session behavior and token lifetimes)StringId → screen-text mapping (→ Localization)One short paragraph per confirmed feature: goal, best Descope approach (Flow, Widget, SSO Setup
Suite, Console, or SDK), differences, action, effort (implementation-nuances.md → Feature Mapping).
Direct, per app or two-stage broker, and why (implementation-nuances.md → Cutover
strategy). List the apps in the order they move, with the test each must pass.
The Step 1c inventory table, the count of customer IdP admins who must act, and a draft notice to send them in advance (what changes, new URL/certificate/secret, date).
Checkboxes, "Required before any testing" and "Required before production":
email, name, oid (and sub if needed — User ID strategy), custom attributes| Remove | Add | Why |
|---|---|---|
AzureAdB2C:Instance, Domain, TenantId, policy IDs (SignUpSignInPolicyId, ResetPasswordPolicyId, EditProfilePolicyId) | DESCOPE_PROJECT_ID | One project replaces tenant + per-policy authorities |
B2C ClientId (SPA / web app) | Inbound App or Federated App client ID / issuer | Client ID from the app's settings page; Inbound App issuer from a real token (implementation-nuances.md → Finding the Inbound App issuer) |
B2C ClientSecret (confidential web apps) | Inbound App secret, or Access Key for a Federated App | New credential — B2C secrets aren't reused |
API ClientId / App ID URI / Scopes | Resource identifier (audience) + scope names | Backend validates aud = Resource |
| — | DESCOPE_MANAGEMENT_KEY | Only for user/tenant/role management |
Start with the user count and chosen password strategy (implementation-nuances.md → User
Migration). PM checklist:
azureObjectId) and tenants before import$select incl. identities and extension_*)Each: what it is, what breaks if ignored, what to do. Include every Execution Phase 4d gotcha that applies, plus the enterprise IdP admins who must act (Step 1c).
Total effort and blocking dependencies at the end.
After writing MIGRATION-PLAN.md, stop and tell the user:
MIGRATION-PLAN.mdhas been written to your working directory. It maps every auth touchpoint found, lists the Console setup needed before the first test, shows which enterprise customers' IT admins will need to make changes, and calls out trade-offs that could affect the timeline.Take a look before we start making changes. When you're ready to proceed, say so.
Do not proceed to Part 3 unless the user confirms.
Execute the Execution Plan from MIGRATION-PLAN.md, following the guidance below.
First — create MIGRATION-STATE.md before touching any code:
# Migration State
_Last updated: [timestamp]_
## Project Context
- Frontend / backend: [e.g., React 18 + ASP.NET Core 8]
- Login mode: [Descope-hosted via Inbound App / Federated App / Embedded Flow]
- API authorization: [Inbound App + Resource / session token]
- Migration goal: [Full cutover / Phased / Evaluating]
- MSAL POC first: [Yes / No — stage: POC / SDK replacement]
## Triage Answers
- Users: [consumers / business SSO / both — N users]
- Sign-in logic: [user flows / custom policies (IEF) / Conditional Access — list all that apply]
- Password strategy: [...]
- User ID strategy: [keep B2C ID / switch / remap on first login]
- Roles source: [...]
- Enterprise connections: [N — N need admin action]
## Files Inventory
| File | Change | Status |
|---|---|---|
## Console Setup Checklist
- [ ] Project — Project ID:
- [ ] Flows:
- [ ] Resource + Inbound App / Federated App:
- [ ] JWT Template:
- [ ] Roles / custom attributes:
- [ ] Tenants + SSO:
## Decisions Log
_(none yet)_
## Current Phase
Phase 1 — Console Setup (not started)
## Next Action
## Blockers
Rule 1 — Re-read MIGRATION-PLAN.md and MIGRATION-STATE.md at the start of every execution turn.
Rule 2 — Before each code change, output a context line:
Migration context: React + ASP.NET Core · Inbound App + Resource · Phase 4, step 3/8 · Next: replace AddMicrosoftIdentityWebApi
Rule 3 — Update MIGRATION-STATE.md immediately after each step.
node_modules/<pkg>/dist/types/, NuGet XML docs).grep -rn "@azure/msal\|Microsoft.Identity.Web\|passport-azure-ad\|b2clogin.com\|B2C_1" \
--exclude-dir=node_modules --exclude-dir=bin --exclude-dir=obj .
AccountInfo /
AuthenticationResult shapes don't carry over.package.json, *.csproj) before writing framework code.
Next.js 15: cookies() / headers() are async.npm view @descope/react-sdk version
npm view @descope/node-sdk version
dotnet package search Descope --exact-match # .NET SDK (NuGet package: Descope)
Ask whether they already have a Project ID and working Flow; if yes, verify items 3–9.
If the Descope MCP Server is connected, offer to make these changes with it. Before the first change,
read the project and show its ID and name, and confirm with the user that it is the environment
recorded in MIGRATION-STATE.md (start with dev). Name that project on every call (projectId on the
*_read / *_write tools, args.projectId on session actions). Then apply each change after the
user approves, elevating first (session → elevate) if the session tool lists that action; if the
user declines a change, skip it.
Otherwise give them as Console steps.
sign-up-or-in; one Flow per B2C user flow / custom policy journey (sign-up-or-in, password reset, profile edit can be one Flow with branches). Check the template library first.tasks.read).email → user.email, name → user.name (not in Descope tokens by default), oid / sub per the User ID strategy, and custom attributes the app reads. For Inbound App tokens, select it on the Inbound App: Session Management → Custom → User JWT template. If it overrides sub, the sign-up Flow must fill azureObjectId for new users, or they can't sign in (implementation-nuances.md → Filling azureObjectId for new users).azureObjectId) under Users → Custom Attributes
before importing users. Then check each attribute's Machine Name and use exactly that in the
JWT Template, the import and the Flow. The Console generates it from the display name, capitalises
the letter after a digit (b2cObjectId → b2CObjectId), and doesn't let you edit it; a mismatch
resolves silently to null, and a sub override from it fails the token request (E063305). Keep
attribute names free of digits.If the MSAL POC was chosen, do it first (implementation-nuances.md → MSAL POC first, then
replace MSAL), run its checklist with the user, then come back here for the SDK replacement.
Read references/implementation-nuances.md in two passes before writing code:
@azure/msal-react → ### React + @azure/msal-react@azure/msal-angular → ### Angular + @azure/msal-angular### Next.js@azure/msal-browser → ### Vue + @azure/msal-browser@azure/msal-browser → ### Plain JavaScript + @azure/msal-browser### Embedded sign-in (iframe) → embedded FlowMicrosoft.Identity.Web OIDC, msal-node, passport-azure-ad OIDCStrategy) → ### Server-side web appsMSAL.iOS, MSAL Android, ROPC) → ### Native / mobilereferences/backend-sdks.mdappsettings*.json — remove the AzureAdB2C section; add a Descope section (ProjectId, Inbound App issuer/audience as needed)..env* — remove AZURE_AD_B2C_* / B2C_* / MSAL_* variables; add DESCOPE_PROJECT_ID (+ framework-prefixed copies in the app's own convention: VITE_* (Vite), REACT_APP_* (Create React App), NEXT_PUBLIC_* (Next.js)).B2C concept → Descope: flows-and-widgets.md → Terminology. How to build each one:
implementation-nuances.md → Feature Mapping.
oid is the B2C user ID — Descope assigns new IDsApps keyed on oid / sub treat every migrated user as new unless the JWT Template carries the B2C
ID over, and new users' IDs aren't GUIDs (implementation-nuances.md → User ID strategy).
scp → scopeB2C access tokens carry granted scopes in scp as a space-separated string of short names
("tasks.read tasks.write"). Descope Inbound App access tokens use scope, also a
space-separated string. Keep the same scope names on the Resource; update the claim name. In
.NET, [RequiredScope] / VerifyUserHasAnyAcceptedScope read scp and its mapped URI claim,
not scope — replace them with a policy that reads scope (see backend-sdks.md).
emails array → emailB2C local accounts emit emails (an array). Code doing emails[0] gets undefined. Add
email via JWT Template and update the code.
Remove: per-policy authorities, account filtering by policy name (homeAccountId /
idTokenClaims.tfp contains B2C_1_…), AADB2C90118 password-reset redirects, tfp/acr
checks, per-policy metadata/JWKS URLs.
iss and aud on Inbound App tokensTake the issuer from discovery, never hardcoded (implementation-nuances.md → Finding the Inbound
App issuer), and check aud = the Resource. .NET and Java SDKs check neither, and Python rejects
Inbound App tokens without audience (backend-sdks.md → Which token does the API receive?).
Plan new or re-obtained credentials (implementation-nuances.md → Secrets, Certificates and Policy Keys).
Create the tenant + SSO first, then import each SSO user into one tenant with the login ID Descope
looks up — <NameID>-<tenantID> (SAML) or <claim mapped to Login ID>-<tenantID> (OIDC) — or
Descope creates a duplicate (implementation-nuances.md → Enterprise SSO users).
Route by exact iss (configured values, not hardcoded) until every client is on Descope and B2C
sessions have expired; size the window from the tenant's refresh-token settings
(backend-sdks.md → Dual-token validation during rollout).
In B2C, a profile-edit user flow redirects back with a fresh ID token, so the app sees new values
immediately. In Descope, claims backed by user attributes update when the session next refreshes.
After a profile update (Flow, User Profile Widget, or Management API), either wait for the SDK's
automatic refresh or call the SDK's refresh (for example useDescope().refresh() in React) before
reading the new claims.
If tokens are delivered as cookies, Descope uses DS (session) and DSR (refresh). Rename them in
the Flow's End action when several Descope projects share one root domain (for example dev and prod
under example.com), and update any backend or gateway code that reads the cookie by name.
Set up an audit connector before cutover (implementation-nuances.md → Audit and sign-in logs).
Hosted (OIDC) login: sdk.oidc.logout() for full OIDC logout. Plain SDK sessions:
sdk.logout() / backend logout(refreshToken) and clear DS/DSR cookies.
The agent doesn't import users. When asked, prepare the export and transform scripts from
implementation-nuances.md → User Migration and run them against the dev
project only. Staging and production imports are run by the team, in that order, after dev sign-in
tests pass.
Scan app code and config only — not this skill's own MIGRATION-*.md files or the custom policy
XML kept for rollback:
grep -rnI "@azure/msal\|Microsoft.Identity.Web\|passport-azure-ad\|b2clogin.com\|B2C_1\|AzureAdB2C\|\.scp\b\|\"scp\"\|emails\[0\]\|AADB2C" \
--include="*.ts" --include="*.tsx" --include="*.js" --include="*.jsx" --include="*.mjs" --include="*.vue" \
--include="*.cs" --include="*.py" --include="*.java" --include="*.kt" --include="*.swift" --include="*.go" \
--include="*.json" --include="*.env*" --include="*.yml" --include="*.yaml" --include="*.properties" \
--include="*.config" --include="Dockerfile" \
--exclude="MIGRATION-*.md" --exclude="package-lock.json" --exclude="*.lock" \
--exclude-dir=node_modules --exclude-dir=.next --exclude-dir=dist --exclude-dir=bin --exclude-dir=obj --exclude-dir=.git .
Fix every hit before continuing. MSAL POC stage: @azure/msal hits are expected until the SDK
replacement — the sweep must be clean before cutover. Phased rollout: the dual-token validator and the code that
accepts scp are expected to remain — exclude those files until B2C is decommissioned, then run the
full sweep again. Delete the rollback policy XML after decommission.
npm install && npx tsc --noEmit / dotnet build / pip install -r requirements.txt / mvn compile. Zero errors before continuing. Then start the app.
Failures usually mean fixtures still use B2C claim shapes (scp, emails, oid, tfp).
Without a browser login, check what curl can prove:
curl -s <issuer>/.well-known/openid-configuration returns
200, and its issuer equals the issuer the app is configured with.b2clogin.com. SPAs redirect in JavaScript, which curl can't see.The agent can't complete an interactive login, and Part 3 doesn't import users. List these in
MIGRATION-SUMMARY.md under Not yet verified — needs a person, with exact steps:
b2clogin.com.aud is still the Resource (the SDK's refresh call doesn't send resource). If every call returns
403, check the token's scope first — an Inbound App Flow without Scopes auto approval or the
Inbound App Scopes component issues tokens with no scopes.iss (Inbound App issuer), aud (Resource), scope, email, oid (and sub if
overridden — Descope's ID is then in dsub), roles. Check one migrated user (B2C GUID) and one new
user (Descope U… ID), and confirm the new user's row is created in the app's database. If the
user pastes a token from a test login, decode it and check these claims for them.Report results in a short table: what the agent verified, what's left for a person, and blockers before going live.
Do not proceed to Part 4 (Wrap-up) until: the Test 1 sweep is clean (allowing the dual-token code in phased mode), the build passes, the app starts, and the Test 4 checks pass. Test 5 items don't block the wrap-up — they move to the summary as not yet verified.
Follow the Cutover Strategy in MIGRATION-PLAN.md (implementation-nuances.md → Cutover strategy).
The agent can draft the customer IdP admin notices and the cutover checklist; DNS changes, Worker
deployment and B2C decommissioning are done by the team. No app goes to production on MSAL pointed
at Descope — the SDK replacement comes first.
Write MIGRATION-SUMMARY.md, scoped to the user's stack, with code snippets and doc links:
idpOIDCClaims, idpSAMLAttributes): https://docs.descope.com/flows/dynamic-keysWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
14 skills in this plugin
/auth0-to-descopeUse this skill whenever anyone asks about migrating from Auth0 to Descope — whether they're a developer doing it themselves or a technical lead evaluating the move. Triggers on: "how do I migrate from Auth0", "replace Auth0 with Descope", "we're moving off Auth0", "Auth0 to Descope", "switch from Auth0", "our app uses express-openid-connect / nextjs-auth0 / auth0-fastapi / other Auth0 SDK and we want to use Descope instead", or any question about Auth0 features (Actions, FGA, Organizations, Token Vault, CIBA) in the context of Descope. Works for any language or framework with a Descope SDK. Always use this skill before producing migration guidance — do not rely on memory alone.
/auth-reviewStatic security review for authentication and authorization vulnerabilities. Use when the user invokes /auth-review, asks to audit auth, find identity breaches, review access control, hunt for IDOR/BOLA, or check authorization. Framework- and vendor-agnostic. Enumerates every route/endpoint, builds an authorization matrix, applies a vulnerability catalog, and writes a triage report ready to turn into issues or PRs./descope-authIntegrate Descope authentication into applications. Use when implementing login, signup, passwordless auth (OTP, Magic Link, Passkeys), OAuth, SSO, or MFA. Detects framework and provides targeted guidance.npx claudepluginhub descope/skills --plugin descope-skillsOther plugins' skills for the same job