mcpField
D
descope-auth

descope-auth

github.com/descopeSecurity1876 installsUpdated 1d ago
Repository

About descope-auth

descope-auth is a skill for integrating Descope passwordless authentication into frontend and backend projects. It directs developers to framework-specific guidance and emphasizes secure session validation.

Key features

  1. 01Framework-specific setup guidance
  2. 02Descope Flow selection
  3. 03OTP, magic link, and passkey methods
  4. 04OAuth and SSO options
  5. 05Secure session validation guidance

Use cases

  1. 01Adding passwordless sign-in to a Next.js app
  2. 02Integrating authentication in React or Angular
  3. 03Validating sessions in a backend
  4. 04Choosing a supported Descope Flow

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/descope/skills --skill descope-auth

After installing, type/descope-authin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
angular.md
backend.md
nextjs.md
react.md
vanilla-js.md

Details

From the project README

Descope Authentication

Integrate secure, passwordless authentication using Descope Flows and SDKs.

Framework Detection

Detect the user's framework and use the appropriate reference:

If project has...Use reference
next in package.jsonreferences/nextjs.md
react (no Next.js)references/react.md
@angular/core in package.jsonreferences/angular.md
No frontend framework (plain HTML/JS)references/vanilla-js.md
Python/Node.js backend onlyreferences/backend.md

Quick Start (all frameworks)

  1. Get Project ID from https://app.descope.com/settings/project
  2. Set environment variable: NEXT_PUBLIC_DESCOPE_PROJECT_ID=<your-id>
  3. Follow framework-specific reference
  4. Verify: After setup, confirm the <Descope> component renders the login form. Check the browser console — a missing or invalid Project ID produces a clear Could not load flows error.
Minimal Inline Example (Next.js)
// 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)}
    />
  );
}

For React SPA or backend-only setups, see the framework-specific references below.

Valid Flow IDs (CRITICAL - do not invent others)

Flow IDPurpose
sign-up-or-inCombined signup/login (RECOMMENDED)
sign-upRegistration only
sign-inLogin only
step-upMFA step-up authentication
update-userProfile updates, add auth methods

Authentication Methods

MethodWhen to use
OTP (Email/SMS)Quick verification codes
Magic LinkPasswordless email links
PasskeysBiometric/WebAuthn (most secure)
OAuthSocial login (Google, GitHub, etc.)
SSOEnterprise SAML/OIDC
PasswordsTraditional auth (not recommended)

DO NOT (Security Guardrails)

  • DO NOT parse JWTs manually - always use SDK's validateSession()
  • DO NOT store tokens in localStorage - SDK handles this securely
  • DO NOT invent flow IDs - only use IDs from the table above
  • DO NOT skip server-side validation - always validate on backend
  • DO NOT expose DESCOPE_MANAGEMENT_KEY in client code

References

  • references/nextjs.md - Next.js App Router & Pages Router integration
  • references/react.md - React SPA integration
  • references/angular.md - Angular integration
  • references/vanilla-js.md - Vanilla JavaScript / plain HTML integration
  • references/backend.md - Backend session validation

Comments

Markdown supported