Skip to main content
The Redirect method sends users to a Didit-hosted page for verification, then returns them to your app via a callback URL.

When to Use Redirect

  • Cross-device verification: Start on desktop, complete on mobile
  • Maximum compatibility: Works in all browsers, including older ones
  • Simple integration: No iframe configuration needed
  • Camera issues: When iframe camera access is problematic

Implementation

Step 1: Create a session (backend)

The session-create response uses a field named url — pass that value to the browser.

Step 2: Redirect the User (Frontend)

HTML:
React:
Vue:

Handling the Callback

When verification completes, Didit redirects to your callback URL with query parameters:

Next.js Example

Express.js Example

Vue Router Example


Open in New Tab

If you prefer to keep your app open while the user verifies:
When using new tabs, combine with webhooks to know when verification completes.

Security Best Practices

Verify the callback server-side

Treat the verificationSessionId and status query parameters as untrusted UI hints. Always confirm the final decision on your backend — either by handling the webhook (preferred) or by re-fetching the decision via the API:

Use Webhooks

For the most reliable integration, use webhooks to receive verification results directly to your backend, regardless of how the user’s browser behaves.

Cross-Device Flow

The redirect method naturally supports cross-device verification:
  1. User clicks “Verify” on desktop
  2. User is redirected to verification page
  3. If needed, user can scan QR code to continue on mobile
  4. After completion, the user is redirected to your callback URL — which device redirects is controlled by callback_method (initiator, completer, or both)

Troubleshooting

Callback Not Received

  1. Verify the callback URL is correctly set when creating the session
  2. Ensure your callback URL is accessible from the internet
  3. Check that the URL doesn’t have typos or encoding issues

Status Always “Declined”

  1. Check your workflow settings in the Didit Console
  2. Verify the test documents you’re using are valid
  3. Review the session details via API for specific decline reasons

Redirect Loop

  1. Ensure your callback handler doesn’t redirect back to verification
  2. Check for caching issues on your callback page
  3. Clear browser cache and try again

Example Repository

GitHub Repository

View source code and examples on GitHub