© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•3y ago•
2 replies
dominik

How to enforce MFA for all users?

Hi I am currently looking through the MFA docs and found these examples of enforcing MFA for all users.
https://supabase.com/docs/guides/auth/auth-mfa#enforce-rules-for-mfa-logins

However, this example does not work obviously because the table name isnt specified. I read through the docs and cant find a proper example on where to enforce this policy? Is it the auth.users table?

I tried using this:
create policy "Enforce MFA for all users - new and existing"
  on auth.users
  as restrictive
  to authenticated
  using (auth.jwt()->>'aal' = 'aal2');
create policy "Enforce MFA for all users - new and existing"
  on auth.users
  as restrictive
  to authenticated
  using (auth.jwt()->>'aal' = 'aal2');

but its giving me an error
Bildschirmfoto_2024-01-13_um_08.36.32.png
Multi-Factor Authentication | Supabase Docs
Add an additional layer of security to your apps with Supabase Auth multi-factor authentication.
Multi-Factor Authentication | Supabase Docs
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Allow CRUD for all auth users
SupabaseSSupabase / help-and-questions
4y ago
How do i list all users?
SupabaseSSupabase / help-and-questions
3y ago
mfa
SupabaseSSupabase / help-and-questions
2mo ago
is there a way to not enforce uniqueness of email id for oauth users?
SupabaseSSupabase / help-and-questions
4y ago