Skip to content

Two-factor authentication with Google via Puppeteer

Notifications You must be signed in to change notification settings

the-type-founders/continue-with-google

Repository files navigation

Continue with Google

The package provides a two-factor authentication with Google via Puppeteer.

Installation

npm install @thetypefounders/continue-with-google --save

Usage

import { authenticate } from '@thetypefounders/continue-with-google';
import Puppeteer from 'puppeteer-extra';
import StealthPlugin from 'puppeteer-extra-plugin-stealth';

Puppeteer.use(StealthPlugin());

const browser = await Puppeteer.launch();
const page = await browser.newPage();

// Go to a page that supports Google.
await page.goto('...');
await page.waitForSelector('...');

// Click on the continue-with-Google button.
await page.click('...');

// Finalize the authorization flow and wait for a selector after redirection.
const element = await authenticate(page, email, password, secret, selector);

About

Two-factor authentication with Google via Puppeteer

Resources

Stars

Watchers

Forks