Authenticator Assurance Level (AAL) is the measure of the strength of an authentication mechanism.
In Supabase, having an AAL of aal1 refers to having the 1st factor of authentication such as an email and password or OAuth sign-in while aal2 refers to the 2nd factor of authentication such as a time-based, one-time-password (TOTP).
If the user has a verified factor, the next field will return AuthenticatorAssuranceLevel.AAL2, else, it will return AuthenticatorAssuranceLevel.AAL1.
Examples
Get the AAL details of the current session
val (current, next) = supabase.auth.mfa.getAuthenticatorAssuranceLevel()
Check whether the user has at least one verified factor
val (enabled, _) = supabase.auth.mfa.status
//flow variant, automatically emitting new values on session changes
val statusFlow = supabase.auth.mfa.statusFlow
Check whether the user is logged in using AAL2
val (_, active) = supabase.auth.mfa.status
//flow variant, automatically emitting new values on session changes
val statusFlow = supabase.auth.mfa.statusFlow