![]() Totp totp = new Totp("nlyyriaxspwdomi7buvo32cuas6tz7aa") // 2FA secret key Replace with your security key copied from step 12 * Method is used to get the TOTP based on the security token Step 2 : Create TOTPGenerator.java class and paste the below code import .otp.Totp Step 2 : Copy the external library code based on your project and paste it in your build file. Note: Example used in this article is written in JAVA-Gradle project! You can implement the program that computes the Authenticator code inside your test script easily. If your test application is enabled with google’s two-factor authentication, you should get the time-based verification code (TOTP) from authenticator mobile app and sign in to your account every single time.īut, in an end-to-end testing, how can the test script grab the verification code without accessing the mobile application? Google Authenticator App has been setup successfully!!Īutomate Two-factor authentication (2FA) using Selenium So going forward, Gmail sign in will prompt for password and verification code. Step 1: Navigate to your google security settings
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |