Skip to content

authsignal/nextjs-reference-example

Repository files navigation

Passkey Authentication Demo

A Next.js application demonstrating passkey step-up authentication with Authsignal.

Features

  • Passkey Enrollment: Register WebAuthn/FIDO2 authenticators
  • Passkey Authentication: Secure login with biometrics or security keys
  • Transaction Verification: Step-up authentication for high-value transactions
  • Enrollment Status: Check if users have passkeys enrolled

Getting Started

  1. Install dependencies:

    pnpm install
  2. Set up environment variables:

    cp .env.example .env.local
    # Add your Authsignal API credentials
  3. Run the development server:

    pnpm dev
  4. Open http://localhost:3000

Demo Credentials

  • Email: demo@example.com
  • Password: password123

API Endpoints

  • POST /api/passkey/check-enrollment - Check if user has passkeys
  • POST /api/passkey/enroll - Start passkey enrollment
  • POST /api/passkey/validate - Validate passkey challenge
  • POST /api/passkey/verify-transaction - Verify high-value transactions

Security

All endpoints require authentication and use server-side user identification to prevent user impersonation attacks.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published