Skip to main content

Multi-factor authentication

Overview

Multi-factor authentication (MFA) is a security process that requires users to verify their identity through multiple forms of credentials before gaining access to a system. SuperTokens allows you to integrate MFA in your application using either Email/SMS One-Time Password (OTP) or Time-based One-Time Password (TOTP).

Prerequisites

This feature is only available to paid users.

Magic link via email or SMS is only supported as a first factor for pre-built UI. It will not work as a second factor because if the magic link is opened on a different device, there would be no reference to the existing session (which was created before first factor completion). Instead, you can use OTP based authentication, using email or SMS. It achieves the same level of security as a magic link.

Getting started

The quickest way to get a glimpse of how MFA works with SuperTokens is to use the example app. Just run the following command to get started:

npx create-supertokens-app@latest --recipe=multifactorauth

Besides that, you can check the initial quickstart guide for step-by-step instructions, along with the other guides for more specific use cases.

Before you explore a guide, read through the Important Concepts page first. It explains several topics that get used in each tutorial.

Customization

To adjust the functionality to fit your use case you can explore different sections from the documentation.