Skip to main content
Beyond Prelude’s managed steps (verify_sms, verify_email), you can define custom steps that your own backend handles — KYC review, biometric verification, document upload, or any other process. When a custom step is reached, your backend verifies the user and issues a signed token that Prelude validates to advance the challenge. Make sure you are familiar with the Step-Up Authentication flow before reading this page.

Prerequisites

  • A working step-up configuration
  • An RSA key pair for signing verification tokens
  • A public JWKS endpoint exposing your public keys

Setup

1. Register your custom step keys

Add your custom step keys and JWKS URL to the step-up configuration:
Step keys must only contain: a-z, A-Z, 0-9, and .-_:.

2. Expose a JWKS endpoint

Your jwks_url must serve a standard RFC 7517 JSON Web Key Set containing the RSA public keys used to verify your verification tokens. Each key must include a kid (key ID).
Prelude caches your JWKS for 10 minutes and automatically re-fetches on key-not-found to handle key rotation.

3. Return custom steps from your hook

In your hook response, include your custom step keys alongside any managed steps:
Steps are completed in order. In this example, the user first completes SMS verification (handled by Prelude), then your KYC review.

Completing a custom step

When the challenge reaches a custom step, the user completes it on your side (your UI, your backend logic). Once verified, your backend issues a verification token and the user sends it to Prelude to advance the challenge.

1. Issue a verification token

Your backend creates an RS256 JWT signed with your private key:

Token fields

Token requirements

Example (Node.js)

2. Advance the challenge

Once your backend issues the verification token, the frontend SDK advances the challenge:
See the Web SDK Step-Up guide for full details. Prelude validates the token by:
  1. Fetching your public keys from your JWKS endpoint
  2. Verifying the RS256 signature and expiration
  3. Checking that sub, challenge_id, and key match the challenge token
  4. Checking the jti has not been used before
If all steps are now done, the SDK automatically refreshes the session with the granted scope.

Validation errors