Testing SMS based authentication (2FA/OTP)

How to test applications that use two-factor authentication and one-time TXT message passwords.

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.

Features

Create test phone numbers in multiple regions including US and UK. Test your application in any language or framework, submit the phone number during sign-up, then use MailSlurp's waitFor 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.

Documentation

Example projects

Related content

Test SMS phone numbers

Read text messages in code and webhooks to test applications and authentication end-to-end. Real phone numbers for developers and QA testers.

Best SMS apps for android

Best SMS apps for android

How to Schedule a Text Message

How to Schedule a Text Message

The Way to Ship a Text via Email (And an email through text): A Simple Guide

The Way to Ship a Text via Email (And an email through text): A Simple Guide

Instant messaging platforms compared

Use SMS/TXT messaging platforms to send and receive text at scale

What is an SMS message segment?

Text messages are split into SMS segments when sent.

How to test 2FA OTP login using SMS codes with Playwright

The ultimate guide to testing OAuth one-time-password flows with real SMS MFA. Use Playwright to automate authentication tests with programmable TXT message APIs.

Testing SMS based authentication (2FA/OTP)

How to test applications that use two-factor authentication and one-time TXT message passwords.

Receive inbound SMS TXT messages with API and webhooks

How to create phone numbers and read text messages in code and tests

Ready to dive in?Start building email applications today.