Menu

1 / 2

Supabase Auth MFA Guide — Adding TOTP and OTP to Flutter Apps

DEV Community·kanta13jp1·7 months ago
#lXSJSuxL
#supabase#flutter#webdev#indiedev#auth
Long article (630 words) — no AI summary yet.
Reading 0:00
15s threshold

Supabase Auth MFA Guide — Adding TOTP and OTP to Flutter Apps

Supabase Auth has built-in MFA support. Here's how to add TOTP (Google Authenticator compatible) to your Flutter app — covering enrollment, verification, and RLS enforcement.

How MFA Works

User signs in (email + password) — AAL1

If MFA is enrolled → Challenge issued

User enters 6-digit code

Auth upgraded to AAL2

TOTP Enrollment

class MFAService { final SupabaseClient _client ; MFAService ( this . _client );

Future < TOTPSetupResult > enrollTOTP () async { final response = await _client . auth . mfa . enroll ( factorType: FactorType . totp ); return TOTPSetupResult ( id: response . id , qrCodeUri: response . totp !. qrCode , secret: response . totp !. secret , ); } }

Enter fullscreen mode

Exit fullscreen mode

// QR code display QrImageView ( data: setup .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.