Videos
Check out our tutorial video series.
How to test applications that use two-factor (2FA) authentication and one-time TXT/SMS message passwords and codes.
MailSlurp provides a phone number and SMS API for testing application login flows using real messages. By testing with SMS you can be certain that your application 2FA/MFA/OAuth flow is functioning correctly.
SMS two-factor authentication is a common method of verifying user identity during application sign up. During the auth flow a txt message containing a secret code is sent to the user's mobile phone. The application then asks the user to enter the code to prove that they have access to the mobile and are therefore the user in question.
Testing application is a very important part of software development. But testing SMs login can be difficult if each user is tied to a real phone number. For that reason many devs use MailSlurp to generate real phone numbers and use these in tests to capture inbound txt messages and extract their content.
This process is often written in an automated test framework like Selenium, CypressJS or Playwright in conjunction with the MailSlurp plugin. Here is an example of what waiting for an expected SMS message looks like:
With MailSlurp you can create test phone numbers in multiple regions including US and UK. These numbers can be controlled in code and tests to verify test users. Test your application in any language or framework, submit the phone number during sign-up, then use MailSlurp's methods to capture the expected SMS and extract a confirmation code. Use this confirmation code to complete sign-up with a test user and confirm authentication in your application.
If you're ready to try it out see these links below to get started or read on for more details:
Check out our tutorial video series.
Email and SMS guides for automation and testing.
View github project code for multiple languages.
Latest posts from the MailSlurp team.
Test, build, and automate messaging with a free MailSlurp account.