---
title: "Securing your Flutter apps with Multi-Factor Authentication"
description: "A Flutter app can require TOTP-based multi-factor authentication on top of email/password sign-in using Supabase Auth."
url: "https://swe.quest/articles/securing-your-flutter-apps-with-multi-factor-authentication-3b61ac67b5f2e6f9"
canonical: "https://supabase.com/blog/flutter-multi-factor-authentication"
source: "Supabase"
published: "2023-05-04"
difficulty: "medium"
kind: "How-to"
reading_minutes: 18
tags: ["identity-auth","mobile"]
---

# Securing your Flutter apps with Multi-Factor Authentication

A post on [Supabase](https://swe.quest/sources/supabase.md), published 2023-05-04, 18 min read, How-to. Original: [https://supabase.com/blog/flutter-multi-factor-authentication](https://supabase.com/blog/flutter-multi-factor-authentication)

## Summary

A Flutter app can require TOTP-based multi-factor authentication on top of email/password sign-in using Supabase Auth. The walkthrough covers setting up supabase\_flutter and go\_router, configuring iOS and Android deep links for email confirmation callbacks, and building signup, enrollment and login-verification pages. Enrollment calls mfa.enroll() to get a QR code and secret, then runs mfa.challenge() and mfa.verify() with the 6-digit code and refreshes the session. Login follows signInWithPassword() with a verification step before the user can reach protected content.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Identity & auth](https://swe.quest/tags/identity-auth.md) (Security)
- [Mobile](https://swe.quest/tags/mobile.md) (Web & mobile)

## Prerequisites

- Flutter basics
- Dart
- Supabase Auth basics ([easy posts on Identity & auth](https://swe.quest/tags/identity-auth.md?difficulty=easy))

## Keywords

Supabase, Flutter, TOTP, go\_router, supabase\_flutter, MFA

## Related posts

- [Supabase Flutter SDK 1.0 Developer Preview](https://swe.quest/articles/supabase-flutter-sdk-1-0-developer-preview-9e19816587705422.md): Supabase · 2022-08-02 · Medium · 5 min read · Mobile, Identity & auth, API design
  Supabase Flutter SDK 1.0 enters developer preview with a focus on developer experience.
- [Getting started with Flutter authentication](https://swe.quest/articles/getting-started-with-flutter-authentication-3f9d7f6366544382.md): Supabase · 2023-07-18 · Medium · 8 min read · Identity & auth, Mobile
  Google sign-in for a Flutter app works by using the google\_sign\_in package to obtain an OIDC ID token and access token.
- [Getting started with React Native authentication](https://swe.quest/articles/getting-started-with-react-native-authentication-41c0c8f4add48c30.md): Supabase · 2023-11-16 · Medium · 9 min read · Identity & auth, Mobile, React, TypeScript
  Supabase Auth can be wired into an Expo/React Native app by configuring supabase-js with AsyncStorage for session persistence and disabling URL session detection.
- [Supabase Auth: SSO, Mobile, and Server-side support](https://swe.quest/articles/supabase-auth-sso-mobile-and-server-side-support-6a2bc9b0f4a5ef26.md): Supabase · 2023-04-13 · Medium · 7 min read · Identity & auth, PostgreSQL, Multi-tenancy, Mobile
  Supabase Auth adds SAML 2.0 single sign-on, a PKCE authorization flow for server-side rendering and mobile apps, and native Sign in with Apple on iOS.
- [Flutter Authorization with RLS](https://swe.quest/articles/flutter-authorization-with-rls-f1170d28eed05738.md): Supabase · 2022-11-22 · Medium · 25 min read · PostgreSQL, Identity & auth, Mobile, Real-time systems
  Extends a basic Flutter real-time chat app into a 1-on-1 chat with authorization enforced by PostgreSQL Row Level Security on Supabase.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
