dazzling-napkin-4938
02/28/2024, 11:21 PMbland-eye-99092
03/01/2024, 8:30 AMdazzling-napkin-4938
03/06/2024, 3:05 AMdazzling-napkin-4938
03/06/2024, 3:06 AMbland-eye-99092
03/06/2024, 8:10 AMbland-eye-99092
03/06/2024, 8:12 AMTo start a new MFA flow, for an already existing session, create a new login flow with theparameter set toaal
. You’ll also need to specify which trait to use for delivering the code to the user. Make sure, this trait exists in the identity schema and set theaal2
parameter to its identifier. For example, if you have a trait calledvia
, you’d setphone_number
tovia
.phone_number
dazzling-napkin-4938
03/07/2024, 12:48 AMwhoami:
required_aal: highest_available
The user will not be able to get their session info at aal1
, and Kratos will redirect the client to an aal2
login flow where they can enter the code from their authenticator app.
In addition, the available_aal
column in Kratos’s identities table changes to aal2
when the user has configured an authenticator app (not that this is visible anywhere from the frontend API.
However, if the user has added a verified phone number to their account, and Kratos is configured to allow 2FA via sms, Kratos behaves completely differently.
whoami will return the session info just fine at aal1
. Yes, you can create an aal2
login flow on the client, but Kratos doesn’t seem to care and does not consider SMS 2FA to mean that the higher aal is available.
This is also the case with settings flows set to highest_available
- I would expect that Kratos would require aal2 if the user has configured their phone number correctly, but it does not. It means that you can do things like change a password, get recovery codes, etc. without the higher AAL.
What’s the point in going through an SMS 2FA flow if Kratos doesn’t seem to care about it?