MFA is set per app. Step-up is set per permission and asks for a fresh verification before one action, independent of sign-in.
Policy#
| Setting | Values | Default |
|---|---|---|
| mfa_policy | disabled, optional, required | disabled |
| mfa_methods_allowed | Any of totp, sms, email, backup_codes (at least one while MFA is on) | ["totp", "sms", "email", "backup_codes"] |
| mfa_grace_period_days | Days a new user may sign in before enrolling, when the policy is required | 7 |
- optional: the user signs in and the session response includes mfa_enrollment_suggested and available_methods.
- required within the grace period: the session is issued with mfa_grace_days_remaining.
- required after the grace period: the user gets a setup-only token and must enroll a factor before a session is issued.
Factors#
| Factor | Method value |
|---|---|
| Authenticator app | totp |
| SMS code | sms |
| Email code | |
| Backup code | backup_codes (a backup code challenge uses method backup_code) |
A passkey sign-in already proves two factors and skips MFA by default (app setting webauthn_skip_mfa, default true).
An email code does not count as the second factor when the first step was also email (a magic link, an email code or an invite).
Signing in with MFA#
When a user with MFA signs in, the response is a challenge instead of a session:
{ "mfa_required": true, "app_user_id": "0193f900-aaaa-bbbb-cccc-eeeeeeeeeeee", "mfa_challenge": { "token": "ch_zN4kP2qX9wT5aB3xY9QkLm7RsT2uVw8E", "status": "pending", "purpose": "mfa", "method": "totp", "expires_at": "2026-11-19T14:30:00Z", "remaining_attempts": 3 }, "available_methods": ["totp", "backup_codes"]}Complete it with verifyMfaChallenge(token, code, { trustDevice }) in @scute/js-core, which posts the code to /v1/auth/:app_id/challenges/:token/verify. switchMfaMethod moves the challenge to another enrolled factor.
Other @scute/js-core methods: listMfaMethods, getMfaStatus, enrollMfa, verifyMfaEnrollment, removeMfaMethod, setDefaultMfaMethod, generateBackupCodes. The React hooks in @scute/react-hooks are useEnrollMfa, useMfaVerify, useFactorList and useBackupCodes. The drop-in <ScuteSignIn /> in @scute/auth-ui-react handles these steps itself.
Trusted devices#
After a sign-in that passed a second factor, the user can trust the device. Later sign-ins on that device skip MFA until the trust expires.
| Setting | Default | Range |
|---|---|---|
| device_trust_enabled | true | |
| device_trust_days | 30 | 1 to 365 |
Trusting is refused with device_trust_off, second_factor_required or device_unknown.
- Endpoints: GET and POST /v1/auth/:app_id/trusted_devices, DELETE /v1/auth/:app_id/trusted_devices/:id.
- In @scute/js-core: trustThisDevice, listTrustedDevices, untrustDevice.
- Webhook events: security.device.trusted, security.device.untrusted.
Backup codes#
POST /v1/auth/:app_id/mfa/backup-codes issues 10 codes in the format XXXX-XXXX. Issuing new codes deletes the unused ones. Scute stores only hashes, so the codes are shown once. The app must allow backup_codes.
Re-verification before MFA changes#
Adding a factor, removing a factor and issuing new backup codes require a recent verification. The window is mfa_reverify_minutes, default 10, allowed 5 to 60. Outside it the API returns 403 verification_required with recent_sign_in_minutes.
Step-up#
Any permission can be marked requires_verification. A check on that permission then returns allow_with_step_up until the user completes a fresh verification bound to the action:
- Your backend starts a challenge with purpose: "step_up" and metadata.authorizes_action set to the permission (authzStartStepUp in @scute/js-core).
- The user completes it.
- Your backend checks again and passes the challenge token as challenge.
The completed challenge must be under 10 minutes old and is spent by the check. The permission's verification_ttl (1 to 86400 seconds) sets how long the proof is reused for that permission afterwards. verification_method restricts which method counts (any or blank allows all). See Authorization.