Identity & SSOvendor:googleEmail OTPUnwrapped Magic LinkCarrier SMS DIDCloud KMS TOTP

Automate Google 2FA, G-Codes & Gmail Forwarding Verification in Playwright

Normalize G-XXXXXX Google verification codes, handle 9-digit Gmail Forwarding Confirmations, and unblock Google Workspace logins in headless browsers.

Curated Stage 4 Extractor Profile (vendor:google)

Automatically strips Google's `G-` prefix (`G-849201` -> `849201`), parses 6–9 digit verification and Gmail Forwarding Confirmation codes, and extracts `accounts.google.com` or `mail-settings.google.com/mail/vf-` links while excluding GCP billing invoices.

Matched Sender Domains
google.comaccounts.google.comyoutube.com
Login URL example: https://accounts.google.com/
Filtered Non-Auth Noise
  • Google Cloud Platform billing & monthly invoices
  • Payment receipts and workspace statement alerts

1. 60-Second Gmail & Outlook Auto-Forwarding Filter

Don't want to change your existing account email on Google & Workspace? Keep your corporate inbox on Google & Workspace and forward only verification emails to <identity-slug>@in.sentryrelay.com. Sentry Relay's Stage 2 unwrapper preserves the original Google & Workspace sender header automatically (full setup guide).

# Paste into Gmail -> Settings -> Filters -> Create a new filter ("Has the words")
from:(google.com OR accounts.google.com) ("verification code" OR "security code" OR "G-" OR "Gmail Forwarding Confirmation")

# Action: Forward it to -> <your-identity-slug>@in.sentryrelay.com

2. Copy-Paste Google & Workspace 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 } from '@playwright/test';
import { SentryRelay } from '@sentryrelay/sdk';

const relay = new SentryRelay({ apiKey: process.env.SENTRY_RELAY_API_KEY! });

test('Resolve Google SMS G-code or TOTP during cloud sign-in', async ({ page }) => {
  await page.goto('https://accounts.google.com/');
  await page.fill('input[type="email"]', process.env.GOOGLE_BOT_EMAIL!);
  await page.click('#identifierNext button');

  await page.waitForSelector('input[type="password"]');
  await page.fill('input[type="password"]', process.env.GOOGLE_BOT_PASSWORD!);
  await page.click('#passwordNext button');

  // Wait for Google SMS G-XXXXXX code (automatically normalized to 6 digits)
  const auth = await relay.wait('google-bot', {
    channel: 'sms',
    sender: 'google.com',
    timeout: 35,
  });

  await page.fill('input[type="tel"], input#idvPin', auth.event!.otpCode!);
  await page.click('#idvPreregisteredPhoneNext button, #totpNext button');
});

3. Google & Workspace Production Gotchas

Frequently Asked Questions

Does Sentry Relay return "G-849201" or "849201" for Google SMS codes?
Sentry Relay normalizes the token and returns clean digits ("849201") in otpCode so your Playwright fill() call works without custom string slicing.
Can Sentry Relay auto-confirm Gmail Forwarding without manual clicks?
Yes. Our Google Stage 4 rule detects Gmail Forwarding Confirmation emails, extracts both the 9-digit code and the /mail/vf- verification link, and can also forward it to your primary inbox via Human Fallback.
Why does Google block free disposable VoIP numbers?
Google blocks recycled shared VoIP pools. Sentry Relay provisions isolated, dedicated US carrier local DIDs via Telnyx per Identity.
Provision an Isolated Identity for Google & Workspace

Start free in 3 minutes with @in.sentryrelay.com email + Simulated SMS, or attach a dedicated US carrier Telnyx SMS DID starting on Builder ($29/mo) and Growth/Pro ($79/mo).