> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getpara.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Login Two-Factor Authentication (MFA)

> Ask users for a second factor at sign-in. Para runs the step on its own pages, so the Para Modal and Para-hosted sign-ins need no code.

Login MFA adds a **second factor at sign-in**: after a user authenticates with their first factor (email, phone, OAuth, your [Custom OIDC](https://docs.getpara.com/v3/general/developer-portal-custom-oidc.md) provider, etc.), Para asks them to set up or present a second factor before the login completes and their wallet unlocks.

> [!NOTE]
>
> This is **login-time MFA**: a second factor on every sign-in. It's distinct from Para's **recovery 2FA** (`useSetup2fa` / `useVerify2fa` and the Developer Portal's **Recovery Two-Factor Authentication** setting), which gates account recovery only.

## Turn it on

Set **Login Two-Factor Authentication** on your project's **Security** page in the Developer Portal. See [Developer Portal Security Settings](https://docs.getpara.com/v3/react/guides/customization/developer-portal-security.md#login-two-factor-authentication).

| Mode | Behavior |
| - | - |
| Off | Users are never asked for a second factor. |
| Optional | Users can enroll a second factor, and once they do it's required at every sign-in. |
| Required | Every user enrolls a second factor at their next sign-in. |

When it's on, choose the methods users can enroll: an **authenticator app** (any TOTP app), a **passkey**, or a **password**. A second factor a user has already enrolled is always required for that user, whatever the setting says.

If an account keeps its wallet on the user's device behind a passkey, that passkey is its second factor: the user doesn't set up an authenticator app and isn't asked for anything extra at sign-in. Accounts that keep their wallet on the device behind a password or PIN set up an authenticator app like other users.

## With the Para Modal

No code changes. When a sign-in needs a second factor, the Para-hosted step walks the user through it: setting up a factor the first time (including showing backup codes once), or verifying one they already have. The modal then finishes connecting the wallet as usual.

## With a Custom UI

Para runs the second-factor step on its own pages: both setting up a second factor and verifying one. A custom UI doesn't build 2FA screens, but its sign-in has to reach a Para-hosted page:

* **The sign-in runs on a Para-hosted page** (for example the OAuth popup, or a hosted login or verification URL you open). The second-factor step runs on that same page, and your UI needs no changes.
* **A React Native app collects the email or phone code in its own UI** without opting in to the updated authentication flow. An account that owes a second factor can't finish signing in this way. See [React Native Login 2FA](https://docs.getpara.com/v3/react-native/guides/login-two-factor.md).

## Backup codes

When a user sets up an authenticator app, Para shows them a set of **one-time backup codes** once. A backup code is accepted anywhere an authenticator code is, and each one works once. Para stores only hashes of them.

## Wrong codes and lockout

A wrong code shows how many attempts remain, so the user can try again. After too many wrong codes the sign-in is **locked out**, and the user must sign in again, which resets the count.

## Security

* The authenticator secret is generated and stored encrypted by Para. Setup only ever happens on Para-hosted pages, so your app never handles it.
* Backup codes are single-use and stored as hashes.
* The second factor is enforced on Para's backend: until it's satisfied, the session can't reach the user's wallet. Your UI can't skip it.

## Troubleshooting

> [accordion] The login never asks for a second factor
>
> Check the **Login Two-Factor Authentication** setting on the Developer Portal's Security page. In **Optional** mode only users who have enrolled a factor are asked. In a custom UI, make sure the sign-in runs on a Para-hosted page (see [With a Custom UI](#with-a-custom-ui)).

> [accordion] A correct code doesn't advance the login
>
> The SDK picks the login back up on its own once the second factor is accepted, so don't start authentication again. If you keep a sign-in popup open, leave it open until the wallet connects.

> [accordion] Codes are always rejected
>
> Authenticator codes are time-based, so make sure the device clock is accurate. A user who lost their authenticator can use a backup code.

## Mobile apps

For Swift, Flutter, and React Native, see the platform guides: [Swift](https://docs.getpara.com/v3/swift/guides/login-two-factor.md), [Flutter](https://docs.getpara.com/v3/flutter/guides/login-two-factor.md), and [React Native](https://docs.getpara.com/v3/react-native/guides/login-two-factor.md).

## Next steps

<picture>![Build a Custom UI](https://docs.getpara.com/images/v3/cards/concept-customization.png)</picture>

## [Build a Custom UI](https://docs.getpara.com/v3/react/guides/custom-ui-simplified.md)

The full custom-login flow the MFA prompt plugs into.

<picture>![Custom OIDC](https://docs.getpara.com/images/v3/cards/developer-portal-custom-oidc.png)</picture>

## [Custom OIDC](https://docs.getpara.com/v3/general/developer-portal-custom-oidc.md)

Add your own identity provider as a first factor.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.