Database / Supabase Intermediate to Advanced Interview Questions
How does Supabase enforce multi-factor authentication (MFA) at the session level?
Supabase Auth supports MFA (typically TOTP, an authenticator-app code) as an additional factor layered on top of a user's primary sign-in. After enrolling a factor, a session is tagged with an authenticator assurance level (AAL): aal1 for a session that only completed the first factor, and aal2 once the second factor has also been verified.
Enforcement then happens at the Row Level Security layer rather than only in application UI: a policy can check the session's AAL claim directly and refuse access to sensitive rows (like payment methods or account-recovery settings) unless the session is at aal2, for example using ((select auth.jwt()->>'aal') = 'aal2'). This means MFA enforcement isn't just a login-screen gate that a client could theoretically skip — it's checked by the database itself on every query against the protected table, regardless of which client or code path issues the request.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
