Automate TOTP 2-Factor Authentication (2FA) with Playwright

  Рет қаралды 13,139

AutomateTogether

AutomateTogether

Күн бұрын

A short tutorial to help you understand what goes into automating a TOTP-based 2FA flow using Playwright and the OTPAuth library.
Goal:
Automate a 2FA login using Playwright and OTPAuth.
Note:
There are multiple libraries out there for TOTP generation. Pick the one you like.
Timestamps:
00:00 Introduction
00:33 TOTP for 2FA
01:22 Approaching 2FA automation
02:23 Extracting the TOTP secret
03:48 Recording the script
05:32 Generating the TOTP token
08:19 2FA automation challenges
10:11 Resources
Environment:
- MacBook Pro (13-inch, M1, 2020)
- macOS Monterey (12.2.1)
- Node v14.15.4
- Playwright 1.24.2
Resources:
- QR decoder: zxing.org/w/decode.jspx
- OTPAuth library: hectorm.github.io/otpauth
- The excellent official Playwright docs: playwright.dev
- IETF RFC6238: www.rfc-editor.org/rfc/rfc623...
- ragog.link for more articles and notes
Contact:
- @rag0g on Twitter
- linkedin.com/in/ragog
-@Giovanni Rago on the official Playwright Slack channel
Disclaimer
These videos are meant to teach interested people, professionals and amateurs, how to use browser automation tools such as Playwright to write scripts for testing, synthetic monitoring, scraping and similar use cases. They center around popular websites to demonstrate real world scenarios for automation. Their aim is never to disrupt a website’s availability or violate its terms of service.
Before you attempt automation on a publicly available website, make sure you read the terms and conditions around automation (and specifically scraping) and abide by them.

Пікірлер: 21
@JustOneMoreTourist
@JustOneMoreTourist 5 ай бұрын
Thanks, man! Very educational! I was always wondering how others overcome it!
@BoazRymland-mx9qf
@BoazRymland-mx9qf Жыл бұрын
Very useful indeed, clear and concise!
@MichaelStrother
@MichaelStrother Жыл бұрын
Thank you for creating this... very helpful!
@jaysont5311
@jaysont5311 Жыл бұрын
This is very cool. Thanks for sharing
@HighRollersLounge
@HighRollersLounge Жыл бұрын
That was useful, thank you!
@flaviokonti5522
@flaviokonti5522 Жыл бұрын
Thanks man, this is useful
@pistolprasadyt8748
@pistolprasadyt8748 2 ай бұрын
Awesomr bro.. From India
@marijanarukavina9499
@marijanarukavina9499 8 ай бұрын
How can I make it work with Upwork, they have Authenticator app for OTP but I don’t know how to get secret since there is no QR code
@MrSpinozadp
@MrSpinozadp Жыл бұрын
awesome! thx
@williamflores7323
@williamflores7323 6 ай бұрын
How can I do this in python?
@wangarewakungu9753
@wangarewakungu9753 10 ай бұрын
That was helpful. Kindly do the same with Python.
@soumyabhat5308
@soumyabhat5308 6 ай бұрын
How to automate when you receive OTP via text msg in phone?.
@Vineetkumar-hu2cs
@Vineetkumar-hu2cs 6 ай бұрын
I am too interested to know same asked by @soumyabhat5308
@amritesh94
@amritesh94 Жыл бұрын
Does this work with Microsoft Auth Azure as well? In the QR i am only getting the client secret and not the period and digits
@danielkovacs3664
@danielkovacs3664 Жыл бұрын
good questin it is interesting for me as well
@pedritoap1
@pedritoap1 11 ай бұрын
Amazing, I did it and did work. Do you know if it is possible to do it with python with some library?
@wangarewakungu9753
@wangarewakungu9753 10 ай бұрын
I would like to know as well. Did you get a solution?
@diddi62
@diddi62 10 ай бұрын
me too @@wangarewakungu9753
@davidev9107
@davidev9107 Ай бұрын
Java alternative ?
@mohitomish
@mohitomish Жыл бұрын
Java alternative?
@davidev9107
@davidev9107 Ай бұрын
I search it me too
Automating Multi-Factor Authentication | Or Polaczek
30:03
Selenium Conference
Рет қаралды 11 М.
Two-Factor Authentication (2FA) in Python
12:20
NeuralNine
Рет қаралды 44 М.
A little girl was shy at her first ballet lesson #shorts
00:35
Fabiosa Animated
Рет қаралды 13 МЛН
Sigma girl and soap bubbles by Secret Vlog
00:37
Secret Vlog
Рет қаралды 13 МЛН
КАК ДУМАЕТЕ КТО ВЫЙГРАЕТ😂
00:29
МЯТНАЯ ФАНТА
Рет қаралды 10 МЛН
The most important Python script I ever wrote
19:58
John Watson Rooney
Рет қаралды 174 М.
Playwright Authentication: Shared Account in All Tests
16:34
JoanMedia
Рет қаралды 1,4 М.
How to automate 2FA using SMS with testRigor
8:40
testRigor
Рет қаралды 297
How Hackers Bypass Two-Factor Authentication (2FA)?!
9:20
Loi Liang Yang
Рет қаралды 118 М.
THIS is Playwrights BEST Feature for Web Automation
9:45
John Watson Rooney
Рет қаралды 40 М.
Auth Does NOT Have To Be Hard
17:13
Web Dev Simplified
Рет қаралды 96 М.
iPhone socket cleaning #Fixit
0:30
Tamar DB (mt)
Рет қаралды 17 МЛН
Xiaomi SU-7 Max 2024 - Самый быстрый мобильник
32:11
Клубный сервис
Рет қаралды 521 М.
تجربة أغرب توصيلة شحن ضد القطع تماما
0:56
صدام العزي
Рет қаралды 63 МЛН
НОВЫЕ ФЕЙК iPHONE 🤯 #iphone
0:37
ALSER kz
Рет қаралды 310 М.
Что делать если в телефон попала вода?
0:17
Лена Тропоцел
Рет қаралды 2,9 МЛН
Как удвоить напряжение? #электроника #умножитель
1:00
Hi Dev! – Электроника
Рет қаралды 1,1 МЛН
Look, this is the 97th generation of the phone?
0:13
Edcers
Рет қаралды 7 МЛН