/descope-skills:descope-authfrom descope-skills
Integrates Descope authentication into apps with framework detection. Handles login, signup, passwordless auth (OTP, Magic Link, Passkeys), OAuth, SSO, and MFA.
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.
Integrate secure, passwordless authentication using Descope Flows and SDKs.
Detect the user's framework and use the appropriate reference:
| If project has... | Use reference |
|---|---|
next in package.json | references/nextjs.md |
react (no Next.js) | references/react.md |
@angular/core in package.json | references/angular.md |
| No frontend framework (plain HTML/JS) | references/vanilla-js.md |
Native Android app (com.android.application in build.gradle(.kts), not Flutter/React Native) | references/kotlin.md |
Native iOS app (.xcodeproj/.xcworkspace or iOS Package.swift, not Flutter/React Native) | references/swift.md |
| Python/Node.js backend only | references/backend.md |
NEXT_PUBLIC_DESCOPE_PROJECT_ID, DESCOPE_PROJECT_ID, VITE_DESCOPE_PROJECT_ID in env files), reuse it. Do not create a new project.session tool): call session with action listProjects, show the user the projects' names and IDs, and use the one they pick. Create a new project only when the user asks for one. Name that project on every later call: projectId on the *_read / *_write tools, args.projectId on session actions. If the session tool lists a selectProject action, also select the project with it.https://mcp.descope.com and say that you will then pick or create the project and configure it for them (other regions and per-client setup: https://docs.descope.com/mcp/mcp-server). The user signs in once in the browser; users without a Descope account can sign up there and get a project. Some clients need a restart to pick up a new MCP server. Once connected, go back to sub-step 2 above (listProjects).NEXT_PUBLIC_DESCOPE_PROJECT_ID=<your-id> for Next.js, Descope.setup(...) for Android and iOS)<Descope> component renders the login form. Check the browser console — a missing or invalid Project ID produces a clear Could not load flows error.When the Descope MCP Server is connected, use it for project configuration (e.g. enabling Google login, MFA settings, editing flows) instead of sending the user to the Console. Before any change, make sure the call targets the app's project: name it in projectId and confirm the ID matches the Project ID the app is configured with. Then get the user's approval for that change. If the session tool lists the selectProject and elevate actions, also select the project before the first change and call session with action elevate after the user approves. If the user declines, skip the change.
// src/app/login/page.tsx
import { Descope } from '@descope/nextjs-sdk';
export default function LoginPage() {
return (
<Descope
flowId="sign-up-or-in"
onSuccess={(e) => console.log('Authenticated:', e.detail.user)}
onError={(e) => console.error('Auth failed:', e.detail)}
/>
);
}
This shows only the component. A real sign-in page must also handle returning users, as described in the next section: see section 2 of references/nextjs.md.
For React SPA, Android, iOS, or backend-only setups, see the framework-specific references below.
Descope issues a short-lived session token (minutes) and a long-lived refresh token (weeks). Only the browser SDK turns the refresh token into a new session token. An integration that checks only the session token signs users out after every idle period. Every web integration (Next.js, React) must:
/sign-in?next=/projects/1) and return them there after sign-in.useSession() to finish loading. If the user is authenticated (the refresh token was still valid), send them to next without showing the flow.useSession() in a component rendered on every page. The SDK refreshes only once something calls it, and then also renews an expired token when the user returns to the tab. Before a server action or API call from the client, wait for an expired token to renew.next paths. Parse next with new URL(next, base) and accept it only if the origin is unchanged and the path doesn't start with //. Otherwise use /. String checks such as startsWith('/') are not enough, because browsers strip tabs and newlines from URLs (/%09/evil.com). Anything else is an open redirect.The framework references show the exact code. Follow them.
| Flow ID | Purpose |
|---|---|
sign-up-or-in | Combined signup/login (RECOMMENDED) |
sign-up | Registration only |
sign-in | Login only |
step-up | MFA step-up authentication |
update-user | Profile updates, add auth methods |
| Method | When to use |
|---|---|
| OTP (Email/SMS) | Quick verification codes |
| Magic Link | Passwordless email links |
| Passkeys | Biometric/WebAuthn (most secure) |
| OAuth | Social login (Google, GitHub, etc.) |
| SSO | Enterprise SAML/OIDC |
| Passwords | Traditional auth (not recommended) |
validateSession()useSession() finishes loading, and DO NOT send every signed-in user to a fixed page such as / or /dashboard. Return them to nextnext value without checking it is an in-app pathreferences/nextjs.md - Next.js App Router & Pages Router integrationreferences/react.md - React SPA integrationreferences/angular.md - Angular integrationreferences/vanilla-js.md - Vanilla JavaScript / plain HTML integrationreferences/kotlin.md - Kotlin / Android integration (Native Flows)references/swift.md - Swift / iOS integration (Native Flows, SwiftUI and UIKit)references/backend.md - Backend session validationWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub descope/skills --plugin descope-skills14 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./azure-ad-b2c-to-descopeUse this skill whenever anyone asks about migrating from Azure AD B2C (Azure Active Directory B2C) to Descope — whether they're a developer doing it themselves or a technical lead evaluating the move. Triggers on: "migrate from Azure AD B2C", "replace Azure B2C with Descope", "we're moving off B2C", "B2C end of sale", "Azure AD B2C to Descope", "our app uses @azure/msal-browser / @azure/msal-react / @azure/msal-angular / @azure/msal-node / Microsoft.Identity.Web / passport-azure-ad with b2clogin.com and we want to use Descope instead", or any question about B2C features (user flows, custom policies / Identity Experience Framework, API connectors, b2c-extensions-app custom attributes, identity providers, ROPC, embedded sign-in, scp claim) 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.
Other plugins' skills for the same job