TRUSTIVAN has two kinds of second factor: a time-based one-time password (TOTP) from an authenticator app, six digits and a new code every 30 seconds; and a passkey (WebAuthn), the fingerprint, face or PIN of a device or a password manager. This page covers turning them on for yourself, and, if you own an organization, requiring one for everyone. A second factor applies to people. An API key or a workload credential has none, and the endpoints below refuse one with 403.

Turn it on for your account

1

Start enrolment

Open Settings → Security and start setting up two-factor authentication. TRUSTIVAN issues a secret and shows it as a QR code and as text.Over the API this is POST /api/v1/auth/mfa/enroll. The response carries secret and provisioning_uri (an otpauth:// URI), and it is the only time the secret is returned. A 409 means you are already enrolled.
2

Add it to your authenticator

Scan the code, or paste the secret, into an authenticator app that supports TOTP.
3

Confirm with a code

Enter the six-digit code the app shows. This is POST /api/v1/auth/mfa/confirm with {"code": "123456"}.Until you confirm, the factor challenges nobody: an enrolment you started and abandoned does not protect your sign-in, and Settings says so.
4

Store your recovery codes

Confirming returns ten recovery codes. They are stored hashed and cannot be shown again, so put them in your password manager now.
Confirming signs you out everywhere else. Every other session on your account is revoked, and the browser you enrolled from is given a fresh one.

Signing in afterwards

A correct password no longer returns a session. POST /api/v1/auth/login answers 200 with mfa_required: true and a challenge_token, and sets no cookies. Branch on mfa_required, not on the status code. The session is issued only when that token is exchanged with a code:
code is a current TOTP code or a recovery code. Both are single-use: a TOTP code that has already been spent on your account is refused even inside its 30-second window. A challenge lasts five minutes and allows five attempts. Every failure (wrong code, replayed code, expired or unknown challenge, attempts used up) is the same 401. If you run out, sign in with your password again to get a new challenge.

Recovery codes

Each recovery code works once, in place of a TOTP code, anywhere a code is asked for at sign-in. They are the only self-service way back into an account whose authenticator is lost. Settings warns you when you are nearly out. GET /api/v1/auth/mfa reports the same thing:
To replace the set, use Settings → Security or POST /api/v1/auth/mfa/recovery-codes with a current TOTP code or an unused recovery code. Every previous code stops working the moment the new set is returned.

Passkeys

Open Settings → Security → Passkeys and choose Add a passkey. Your browser asks you to confirm with the device (Touch ID, Windows Hello, a phone or a security key) or to save it in your password manager. An account can hold up to 20. A passkey does two things:
  • Passwordless sign-in. Sign in with a passkey on the sign-in page signs you in with no password. The device verifies you (PIN or biometric), so this is two factors in one gesture. The same SSO enforcement applies as to a password.
  • Second factor. Once you hold a passkey, a password alone no longer signs you in: POST /api/v1/auth/login answers mfa_required with methods: ["passkey", "recovery_code"] (plus totp if you also have an authenticator app), and Use a passkey finishes the sign-in.
A passkey satisfies an organization’s MFA policy exactly as TOTP does. Your first passkey issues recovery codes if you have none; they work in the code field of the sign-in challenge. Removing a passkey needs a fresh proof as well as your session: confirm with a passkey, or enter an authenticator or recovery code. If your organization requires a second factor, the last one you hold cannot be removed until you add another. Over the API: POST /api/v1/auth/passkeys/options, then POST /api/v1/auth/passkeys with the browser’s answer; /auth/passkey/login/options and /auth/passkey/login for passwordless sign-in. The browser ceremony needs the dashboard’s origin; a deployment whose dashboard is not at DASHBOARD_URL sets WEBAUTHN_RP_ID and WEBAUTHN_ORIGINS (environment). A passkey is bound to its relying party ID for life: changing it means every passkey is registered again.

Turn it off

Settings → Security, or DELETE /api/v1/auth/mfa with {"code": "…"}. A current code or a recovery code is required as well as your session. Removing the factor is exactly what somebody holding a stolen session would want to do, so the session alone does not authorize it. If your organization requires a second factor, you are sent through enrolment again at your next sign-in.

Require it for everyone

An owner can require a second factor for every member, under Settings → Security → Require two-factor authentication or:
This needs identity:manage, which only the owner role holds and no API key can be granted. Once it is on:
  • A member with no confirmed factor is held at enrolment on their next password or social sign-in, before any session exists. The sign-in answers with mfa_enrollment_required: true and a challenge token, and the dashboard walks them through the same four steps as above.
  • A member with no confirmed factor cannot renew a session they already have.
  • Single sign-on sessions are exempt. Your identity provider owns that factor, so enforce it there.
Every change to the policy is recorded in the identity audit trail as mfa_policy.changed.
Enrol your own factor before you switch the policy on. You find out how enrolment behaves before your colleagues do, and an owner with a second factor is also the one account that can still sign in with a password when single sign-on is required and your identity provider is unavailable.

Where a code is asked for again

A second factor is not only checked at sign-in. With one enrolled, you are asked for a current TOTP code when you:

See also