Identity & SSOvendor:auth0Email OTPUnwrapped Magic LinkCarrier SMS DIDCloud KMS TOTP
Automate Auth0 Passwordless OTP, Magic Links & MFA in Playwright
Automate Auth0 Passwordless Email OTPs, Universal Login magic links, SMS codes, and Guardian/TOTP challenges in headless browsers.
1. 60-Second Gmail & Outlook Auto-Forwarding Filter
Don't want to change your existing account email on Auth0? Keep your corporate inbox on Auth0 and forward only verification emails to <identity-slug>@in.sentryrelay.com. Sentry Relay's Stage 2 unwrapper preserves the original Auth0 sender header automatically (full setup guide).
# Paste into Gmail -> Settings -> Filters -> Create a new filter ("Has the words")
from:(auth0.com) ("verification code" OR "passwordless" OR "passcode" OR "verify")
# Action: Forward it to -> <your-identity-slug>@in.sentryrelay.com2. Copy-Paste Auth0 2FA Automation Snippets
Choose your browser automation stack below. All snippets resolve codes in <200ms with Upstash Redis 15-second lookback protection so arrived-before-wait race conditions never fail a run.
import { test, expect } from '@playwright/test';
import { SentryRelay } from '@sentryrelay/sdk';
const relay = new SentryRelay({ apiKey: process.env.SENTRY_RELAY_API_KEY! });
test('Auth0 Passwordless Email OTP or Magic Link sign-in', async ({ page }) => {
await page.goto('https://your-app.com/login');
await page.fill('input[name="email"], input#username', 'auth0-bot@in.sentryrelay.com');
await page.click('button[type="submit"]');
const auth = await relay.wait('auth0-bot', { timeout: 30 });
if (auth.event?.magicLink) {
await page.goto(auth.event.magicLink);
} else if (auth.event?.otpCode) {
await page.fill('input[name="code"]', auth.event.otpCode);
await page.click('button[type="submit"]');
}
await expect(page).toHaveURL(/your-app\.com/);
});3. Auth0 Production Gotchas
Custom Tenant SMTP Senders
Many enterprises configure Auth0 to send emails via SendGrid or SES on their own domain rather than `auth0.com`. Omit the `sender` filter (or pass your target company domain) and Stage 4/5 will still match the `/passwordless/verify_redirect` or `/u/email-verification` URL and OTP.
Short-Lived Passwordless Codes
Auth0 passwordless OTPs expire quickly. Sentry Relay's `<200ms` Redis Pub/Sub wakeup guarantees your browser receives the code immediately upon SMTP receipt.
Unwrapped Click-Trackers
Custom SendGrid/Postmark wrappers around `/lo/verify` links are unwrapped before being returned in `magicLink`.