Skip to content

Commit eb0c5ee

Browse files
committed
docs(mfa): document released MFA and Adaptive MFA behavior
- Document Adaptive MFA rules, edge headers, webhook, and policy interactions - Document per-user mfa.required, additional factor suggestion, and implicit email/SMS - Update audit log keys, JWT verification records, Management API, and Account Center routes
1 parent b9a2845 commit eb0c5ee

16 files changed

Lines changed: 284 additions & 56 deletions

File tree

‎docs/developers/actions/post-sign-in.mdx‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ type PostSignInEvent = {
2626

2727
`event.user` includes the standard [user profile](/user-management/user-data#user-profile), plus:
2828

29-
| Field | Description |
30-
| ------------------------ | -------------------------------------------- |
31-
| `hasPassword` | Whether the user has a local password |
32-
| `ssoIdentities` | Enterprise SSO identities linked to the user |
33-
| `mfaVerificationFactors` | MFA factor types configured for the user |
34-
| `roles` | Global roles and their API resource scopes |
35-
| `organizations` | Organizations the user belongs to |
36-
| `organizationRoles` | Organization roles assigned to the user |
29+
| Field | Description |
30+
| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------- |
31+
| `hasPassword` | Whether the user has a local password |
32+
| `ssoIdentities` | Enterprise SSO identities linked to the user |
33+
| `mfaVerificationFactors` | Explicitly stored MFA factor types configured for the user (`Totp`, `WebAuthn`, `BackupCode`); excludes implicit email/SMS MFA factors |
34+
| `roles` | Global roles and their API resource scopes |
35+
| `organizations` | Organizations the user belongs to |
36+
| `organizationRoles` | Organization roles assigned to the user |
3737

3838
The context also includes fields such as `applicationId`, `lastSignInAt`, `createdAt`, and `updatedAt`. It does not include plaintext passwords, password hashes, MFA secrets, or connector token-set secrets.
3939

‎docs/developers/audit-logs/event-types.mdx‎

Lines changed: 48 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,15 @@ Feel free to [contact us](https://logto.io/contact) if you’d like to share you
6060
| Interaction.Register.Verification.Password.Submit | Create and verify identifier with password verification |
6161
| Interaction.Register.Verification.EmailVerificationCode.Create | Create and send register email verification code |
6262
| Interaction.Register.Verification.EmailVerificationCode.Submit | Verify register email verification code |
63+
| Interaction.Register.Verification.PhoneVerificationCode.Create | Create and send register phone verification code |
64+
| Interaction.Register.Verification.PhoneVerificationCode.Submit | Verify register phone verification code |
6365
| Interaction.Register.Verification.SmsVerificationCode.Create | Create and send register SMS verification code |
6466
| Interaction.Register.Verification.SmsVerificationCode.Submit | Verify register SMS verification code |
6567
| Interaction.Register.Verification.Social.Create | Create social authentication URL |
6668
| Interaction.Register.Verification.Social.Submit | Verify social authentication |
6769
| Interaction.Register.Verification.EnterpriseSso.Create | Create enterprise SSO authentication URL |
6870
| Interaction.Register.Verification.EnterpriseSso.Submit | Verify enterprise SSO authentication |
71+
| Interaction.Register.SignInPasskey.Submit | Bind a sign-in passkey to the registering user |
6972
| Interaction.Register.Profile.Create | Put new register interaction profile |
7073
| Interaction.Register.Profile.Delete | Delete register interaction profile |
7174
| Interaction.Register.Profile.Update | Patch update register interaction profile |
@@ -86,8 +89,13 @@ Feel free to [contact us](https://logto.io/contact) if you’d like to share you
8689
| Interaction.SignIn.Identifier.VerificationCode.Submit | Submit and verify sign-in identifier with verification code |
8790
| Interaction.SignIn.Verification.EmailVerificationCode.Create | Create and send sign-in email verification code |
8891
| Interaction.SignIn.Verification.EmailVerificationCode.Submit | Verify sign-in email verification code |
92+
| Interaction.SignIn.Verification.PhoneVerificationCode.Create | Create and send sign-in phone verification code |
93+
| Interaction.SignIn.Verification.PhoneVerificationCode.Submit | Verify sign-in phone verification code |
8994
| Interaction.SignIn.Verification.SmsVerificationCode.Create | Create and send sign-in SMS verification code |
9095
| Interaction.SignIn.Verification.SmsVerificationCode.Submit | Verify sign-in SMS verification code |
96+
| Interaction.SignIn.Verification.SignInPasskey.Create | Create sign-in passkey authentication options |
97+
| Interaction.SignIn.Verification.SignInPasskey.Submit | Verify sign-in passkey authentication |
98+
| Interaction.SignIn.SignInPasskey.Submit | Bind a sign-in passkey to the signing-in user |
9199
| Interaction.SignIn.Identifier.Social.Create | Create social sign-in authorization-url |
92100
| Interaction.SignIn.Identifier.Social.Submit | Authenticate and submit social identifier |
93101
| Interaction.SignIn.Verification.Social.Create | Create social authentication URL |
@@ -113,6 +121,8 @@ Feel free to [contact us](https://logto.io/contact) if you’d like to share you
113121
| Interaction.ForgotPassword.Identifier.VerificationCode.Submit | Submit and verify forgot-password verification code |
114122
| Interaction.ForgotPassword.Verification.EmailVerificationCode.Create | Create and send forgot-password email verification code |
115123
| Interaction.ForgotPassword.Verification.EmailVerificationCode.Submit | Verify forgot-password email verification code |
124+
| Interaction.ForgotPassword.Verification.PhoneVerificationCode.Create | Create and send forgot-password phone verification code |
125+
| Interaction.ForgotPassword.Verification.PhoneVerificationCode.Submit | Verify forgot-password phone verification code |
116126
| Interaction.ForgotPassword.Verification.SmsVerificationCode.Create | Create and send forgot-password SMS verification code |
117127
| Interaction.ForgotPassword.Verification.SmsVerificationCode.Submit | Verify forgot-password SMS verification code |
118128
| Interaction.ForgotPassword.Profile.Create | Put new forgot-password interaction profile |
@@ -121,22 +131,44 @@ Feel free to [contact us](https://logto.io/contact) if you’d like to share you
121131

122132
## MFA \{#mfa}
123133

124-
| Key | Name |
125-
| --------------------------------------------------- | ----------------------------------------------- |
126-
| Interaction.Register.Verification.BackupCode.Create | Create backup codes for MFA binding |
127-
| Interaction.Register.Verification.BackupCode.Submit | Verify backup code |
128-
| Interaction.Register.Verification.Totp.Create | Create TOTP verification secret for MFA binding |
129-
| Interaction.Register.Verification.Totp.Submit | Verify TOTP verification code |
130-
| Interaction.Register.Verification.WebAuthn.Create | Create WebAuthn authentication |
131-
| Interaction.Register.Verification.WebAuthn.Submit | Verify WebAuthn authentication |
132-
| Interaction.SignIn.Verification.BackupCode.Create | Create backup codes for MFA binding |
133-
| Interaction.SignIn.Verification.BackupCode.Submit | Verify backup code |
134-
| Interaction.SignIn.Verification.Totp.Create | Create TOTP verification secret for MFA binding |
135-
| Interaction.SignIn.Verification.Totp.Submit | Verify TOTP verification code |
136-
| Interaction.SignIn.Verification.WebAuthn.Create | Create WebAuthn authentication |
137-
| Interaction.SignIn.Verification.WebAuthn.Submit | Verify WebAuthn authentication |
138-
| TrustedDevice.Created | Create a trusted-device credential |
139-
| TrustedDevice.Used | Use a trusted device to fulfill sign-in MFA |
134+
| Key | Name |
135+
| ----------------------------------------------------------------- | -------------------------------------------------------- |
136+
| Interaction.Register.BindMfa.BackupCode.Submit | Bind backup codes for MFA during registration |
137+
| Interaction.Register.BindMfa.EmailVerificationCode.Submit | Bind email verification code for MFA during registration |
138+
| Interaction.Register.BindMfa.PhoneVerificationCode.Submit | Bind phone verification code for MFA during registration |
139+
| Interaction.Register.BindMfa.Totp.Submit | Bind TOTP for MFA during registration |
140+
| Interaction.Register.BindMfa.WebAuthn.Submit | Bind WebAuthn passkey for MFA during registration |
141+
| Interaction.Register.Verification.BackupCode.Create | Create backup codes for MFA binding |
142+
| Interaction.Register.Verification.BackupCode.Submit | Verify backup code |
143+
| Interaction.Register.Verification.MfaEmailVerificationCode.Create | Create and send register MFA email verification code |
144+
| Interaction.Register.Verification.MfaEmailVerificationCode.Submit | Verify register MFA email verification code |
145+
| Interaction.Register.Verification.MfaPhoneVerificationCode.Create | Create and send register MFA phone verification code |
146+
| Interaction.Register.Verification.MfaPhoneVerificationCode.Submit | Verify register MFA phone verification code |
147+
| Interaction.Register.Verification.Totp.Create | Create TOTP verification secret for MFA binding |
148+
| Interaction.Register.Verification.Totp.Submit | Verify TOTP verification code |
149+
| Interaction.Register.Verification.WebAuthn.Create | Create WebAuthn authentication |
150+
| Interaction.Register.Verification.WebAuthn.Submit | Verify WebAuthn authentication |
151+
| Interaction.SignIn.BindMfa.BackupCode.Submit | Bind backup codes for MFA during sign-in |
152+
| Interaction.SignIn.BindMfa.EmailVerificationCode.Submit | Bind email verification code for MFA during sign-in |
153+
| Interaction.SignIn.BindMfa.PhoneVerificationCode.Submit | Bind phone verification code for MFA during sign-in |
154+
| Interaction.SignIn.BindMfa.Totp.Submit | Bind TOTP for MFA during sign-in |
155+
| Interaction.SignIn.BindMfa.WebAuthn.Submit | Bind WebAuthn passkey for MFA during sign-in |
156+
| Interaction.SignIn.Verification.BackupCode.Create | Create backup codes for MFA binding |
157+
| Interaction.SignIn.Verification.BackupCode.Submit | Verify backup code |
158+
| Interaction.SignIn.Verification.MfaEmailVerificationCode.Create | Create and send sign-in MFA email verification code |
159+
| Interaction.SignIn.Verification.MfaEmailVerificationCode.Submit | Verify sign-in MFA email verification code |
160+
| Interaction.SignIn.Verification.MfaPhoneVerificationCode.Create | Create and send sign-in MFA phone verification code |
161+
| Interaction.SignIn.Verification.MfaPhoneVerificationCode.Submit | Verify sign-in MFA phone verification code |
162+
| Interaction.SignIn.Verification.Totp.Create | Create TOTP verification secret for MFA binding |
163+
| Interaction.SignIn.Verification.Totp.Submit | Verify TOTP verification code |
164+
| Interaction.SignIn.Verification.WebAuthn.Create | Create WebAuthn authentication |
165+
| Interaction.SignIn.Verification.WebAuthn.Submit | Verify WebAuthn authentication |
166+
| TrustedDevice.Created | Create a trusted-device credential |
167+
| TrustedDevice.Used | Use a trusted device to fulfill sign-in MFA |
168+
169+
:::note
170+
`MfaEmailVerificationCode` and `MfaPhoneVerificationCode` verification keys are defined in Logto's audit log schema (`LogKey`), while at runtime the Experience API MFA verification-code endpoints currently log `Interaction.{event}.Verification.EmailVerificationCode.{Create,Submit}` and `Interaction.{event}.Verification.PhoneVerificationCode.{Create,Submit}`.
171+
:::
140172

141173
## SAML application \{#saml-application}
142174

‎docs/developers/custom-token-claims/create-script.mdx‎

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,65 @@ The context object contains the user data and grant data that relevant to the cu
209209
}
210210
```
211211

212+
```ts
213+
// VerificationType.SignInPasskey
214+
{
215+
id: string;
216+
type: 'SignInPasskey';
217+
userId?: string;
218+
verified: boolean;
219+
registrationRpId?: string;
220+
}
221+
```
222+
223+
```ts
224+
// VerificationType.MfaEmailVerificationCode
225+
{
226+
id: string;
227+
type: 'MfaEmailVerificationCode';
228+
templateType:
229+
| 'MfaVerification'
230+
| 'BindMfa'
231+
| 'SignIn'
232+
| 'Register'
233+
| 'ForgotPassword'
234+
| 'OrganizationInvitation'
235+
| 'Generic'
236+
| 'UserPermissionValidation'
237+
| 'BindNewIdentifier';
238+
verified: boolean;
239+
userId?: string;
240+
identifier: {
241+
type: 'email';
242+
value: string;
243+
};
244+
}
245+
```
246+
247+
```ts
248+
// VerificationType.MfaPhoneVerificationCode
249+
{
250+
id: string;
251+
type: 'MfaPhoneVerificationCode';
252+
templateType:
253+
| 'MfaVerification'
254+
| 'BindMfa'
255+
| 'SignIn'
256+
| 'Register'
257+
| 'ForgotPassword'
258+
| 'OrganizationInvitation'
259+
| 'Generic'
260+
| 'UserPermissionValidation'
261+
| 'BindNewIdentifier';
262+
verified: boolean;
263+
userId?: string;
264+
identifier: {
265+
type: 'phone';
266+
value: string;
267+
};
268+
}
269+
```
270+
212271
```ts
213272
// VerificationType.BackupCode (MFA)
214273
{

‎docs/developers/webhooks/events.mdx‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ This guide list the different Logto webhook events and explains when each event
1111

1212
## User interaction webhook events \{#user-interaction-hook-events}
1313

14-
| Event type | Description |
15-
| ----------------- | --------------------------------------------------------------------------- |
16-
| PostRegister | A user successfully creates a new account via the UI interface. |
17-
| PostSignIn | A user successfully signs in via the UI interface. |
18-
| PostResetPassword | A user's password is successfully reset through the "Forgot password" flow. |
14+
| Event type | Description |
15+
| ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------- |
16+
| PostRegister | A user successfully creates a new account via the UI interface. |
17+
| PostSignIn | A user successfully signs in via the UI interface. |
18+
| PostSignInAdaptiveMfaTriggered | [Adaptive MFA](/end-user-flows/mfa/adaptive-mfa) triggers an MFA challenge during a sign-in flow (emitted before MFA verification finishes). |
19+
| PostResetPassword | A user's password is successfully reset through the "Forgot password" flow. |
1920

2021
## Data mutation webhook events \{#data-mutation-hook-events}
2122

0 commit comments

Comments
 (0)