Prerequisites
- A Prelude account with access to the Session API
- An Application ID (
appID) — see Applications - Your Management API key for backend calls
- A working login flow (users must be authenticated before requesting step-up)
How it works
When a user requests a sensitive action, your frontend asks Prelude for a scope grant. Prelude calls a hook on your backend, where you decide whether to grant the scope immediately, require a challenge, or block the request entirely. If you require a challenge, Prelude walks the user through each step you defined. Prelude natively handles managed steps likeverify_sms and verify_email — no extra work on your side. Once every step is completed, the scope is granted to the user’s access token.
You can also define custom steps handled by your own backend (e.g. KYC review, biometric check). See Custom Steps for details.
Configure step-up
Create a step-up configuration
Register your hook URL and allowed scopes.
| Field | Required | Description |
|---|---|---|
signal_hook_url | Yes | The URL Prelude calls when a scope grant is requested. See Step-Up Hook. |
jwks_url | Yes | Your JWKS endpoint. Only required if you use custom steps. |
step_keys | Yes | Custom step keys for client-owned steps. Leave empty if you only use managed steps. |
allowed_scopes | Yes | The scopes that can be requested via step-up. |
Scope names must only contain: lowercase letters, uppercase letters, numbers, and the characters
.-_:.Implement the hook endpoint
Your backend must expose the hook URL you registered. When Prelude receives a step-up request, it calls your hook with user and session context. Your hook decides whether to grant, challenge, or block.See the full Step-Up Hook Reference for the request/response format and constraints.
The step-up flow
1. Request a scope grant
The frontend SDK initiates the flow by callingrequestStepUp with a scope. Prelude calls your hook and returns one of:
| Status | Meaning |
|---|---|
continue | Scope granted immediately, no challenge needed. The SDK refreshes the session automatically. |
review | A challenge was created. The user must complete all steps. |
block | Scope denied. |
2. Complete managed steps
Prelude handles the following step types natively:| Step key | Description |
|---|---|
verify_sms | SMS OTP verification sent to the user’s phone number. |
verify_email | Email OTP verification sent to the user’s email address. |
otpCreate, otpCheck, and otpRetry methods to drive these steps using the challengeId from the onChallenge callback.
3. Automatic completion
When the last step is completed, the SDK automatically refreshes the session with the granted scope. The new access token behavior depends on thegrant_mode set by your hook:
| Grant mode | Behavior |
|---|---|
single-use | The scope is attached only to this access token and expires after granted_for seconds. It is not persisted on the session. |
session-bound | The scope is stored on the session and included in every subsequent refresh for granted_for seconds. |
Constraints and validation
Field format
All external fields (scopes, step keys, metadata keys) must match:Metadata
| Rule | Limit |
|---|---|
| Maximum number of fields | 5 |
| Maximum key length | 12 characters |
| Maximum value length | 32 characters |
Hook response
| Rule | Limit |
|---|---|
| Maximum response size | 64 KB |
granted_for | In seconds. Must be between 0 and 86400 (24 hours). Cannot be negative. |
granted_for default | When grant_mode is session-bound and granted_for < 1, it defaults to 600 seconds (10 minutes). When grant_mode is single-use, granted_for must be at least 1. |
| Hook timeout | 5 seconds. Your endpoint must respond within this time. |
Step expiration_duration | In seconds. Must be between 0 and 86400 (24 hours). Cannot be negative. |
Step-Up JWKS
Prelude exposes a dedicated JWKS endpoint for step-up token verification at:Security recommendations
- Limit scope lifetime: Use the
granted_forfield to keep scoped access as short-lived as practical. A transfer confirmation might only need 60 seconds. - Use
grant_mode: "single-use"for high-sensitivity operations (e.g. fund transfers). This ensures the scope is attached to a single access token and not persisted on the session. - Validate signals in your hook: Prelude sends
user_agent,platform, andipin the hook request. Use these to detect suspicious context changes (e.g. a different IP than the original login).
What’s next?
Custom Steps
Add client-owned steps like KYC review or biometric checks to your challenges.
Step-Up Hook
Full API reference for the hook endpoint your backend must implement.
- Browse the Step-Up API Reference for full endpoint details
- Configure step-up via the Management API