DEV Community

Cover image for I Found a way to Automate 2FA and TOTP.
Gokul E
Gokul E

Posted on

I Found a way to Automate 2FA and TOTP.

Hello Readers,
After very long time now I am back with a very interesting topic for Automation Testers. I’ve recently see a post in linked In about the beeceptors. That post contains a lot of information of a very good advantage of use the Beeceptor Api which we can use to overcome the dificulty of 2FA ( 2-Factor Authentication) and TOTP (Time-based One-Time Passwords).

We know most of the big application like Github, Zerodha, Instagram even Google and many more. All these applications are have a 2FA and TOTP to login for security purpose. For these 2FA and TOTP are nightmare of Automation Tester. In order to overcome that problem, some of the companies skip the authentication with constant code or disabled authentication page login.

Recently I get to know that there a tool called Beeceptors through a significant linked In post. After I read that along with some more of the other blogs and sources, I get know that, we can mock that 2 factor authentication by using Mock API to simulating different API’s for authentication.

We can create our own end points for different response and get the results for the best automation scripts with all the possible scenarios and use cases. Using a website https://beeceptor.com/ , we can create our own mock servers and endpoints with specific rule, secret and authentications.

Time-Based One-Time Passwords (TOTP) are often used in 2FA. Mock APIs can generate mock TOTP codes to test the verification process within the applications.

Using mock APIs helps us isolating 2FA and TOTP testing from production environments, reducing risks associated with live testing.

By using the services like beeceptors which provides mock API’s similar capabilities make Testing is very helpful to test the application more robust and reliable before Deployment.

These were the things I learned in weekends to improve my automation testing skills. In near future I’ll write another blog with more detailed information with practical implementation.

Thank you for your time to read my blog. Until Next Time.

Best wishes to all.

Top comments (0)