An admin password can leak through a reused login, a phishing page or a note on a desk. With two-factor sign-in on, LyEve asks for a code from your phone after the password, and the password alone opens nothing.
An authenticator app and backup codes cost nothing, with or without a license. Each person turns them on for their own account, in LyEve Console or over the API.
Your account and an authenticator app
- A LyEve install with the console. It runs on PostgreSQL, MySQL or SQL Server, each with the connection string under supported databases. Our run used PostgreSQL 16 and no license key on November 11, 2026, with the LyEve engine v0.62.0 and admin console v0.28.0.
- Your own account. We ran the steps on a super admin and on an admin account.
- An authenticator app, such as 1Password, Authy or Google Authenticator.
- For the API steps, your token in
TOKEN, from a sign-in as in the quickstart.
1. Turn on the authenticator app
Console v0.28.0
- Open the account menu, your email address at the top right, and choose Two-factor authentication.
- Choose Turn on two-factor authentication.
- Scan the QR code with the app, or copy the Manual entry secret into it.
- Enter The 6-digit code from the app and choose Verify and turn on.
Engine API v0.62.0
Check the account first:
curl http://localhost:3001/api/admin/mfa/status \
-H "Authorization: Bearer $TOKEN"{"enabled":false,"has_passkeys":false,"passkeys":[]}Start the setup:
curl -X POST http://localhost:3001/api/admin/mfa/totp/setup \
-H "Authorization: Bearer $TOKEN"The answer holds secret and provisioning_uri, an otpauth:// address. Type secret into the app, or show provisioning_uri as a QR code and scan it. Then send the code the app shows:
curl -X POST http://localhost:3001/api/admin/mfa/totp/verify \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"code": "123456"}'{"backup_codes":["ca54b9ff97b9bfe1","b085e26601896426","..."],"enabled":true}The code changes every 30 seconds, and the app keeps the secret on your phone. From now on a sign-in to this account asks for it.
2. Save the backup codes
The backup codes are how you sign in when the phone is lost. There are eight, each 16 characters, and each works once in place of a code from the app.
Console v0.28.0
The page lists the eight codes under Save these backup codes somewhere safe. They are not shown again. Choose Copy all codes, put them in a password manager or on paper, and choose Done.
Engine API v0.62.0
They are the backup_codes in the answer of step 1. Store them before you close the terminal.
Keep them away from the phone, or one loss takes both.
3. Sign in with a code from the app
Wait for the app to show a new code first. The code from step 1 is spent, and LyEve accepts each code once.
Console v0.28.0
- Open the account menu and choose Sign out.
- Sign in with your email address and password. The page asks for Two-factor verification.
- Enter the code in Authenticator code and choose Verify. The dashboard opens.
Engine API v0.62.0
Sign in with your password as before:
curl -X POST http://localhost:3001/api/admin/auth/login \
-H "Content-Type: application/json" \
-d '{"email": "ada@example.com", "password": "your-password"}'The answer is now a challenge instead of a session:
{"challenge_token":"eyJhbGciOi...","mfa_methods":["totp"],"mfa_required":true}Copy challenge_token into CHALLENGE and finish with the code:
curl -X POST http://localhost:3001/api/admin/auth/mfa-verify \
-H "Content-Type: application/json" \
-d '{"challenge_token": "'"$CHALLENGE"'", "code": "123456"}'The answer is a normal sign-in, with token and refresh_token.
4. Test a backup code
Test one now, while the phone still works. A code you have used once is one you know works.
Console v0.28.0
Sign out and sign in again. On Two-factor verification, enter the first backup code in Authenticator code and choose Verify. The dashboard opens.
Engine API v0.62.0
Sign in with the password for a new challenge, then send the backup code in the same code field to /api/admin/auth/mfa-verify. The answer is the same sign-in as in step 3.
Cross that code off. It is spent, and a sign-in that sends it again answers 422 with The provided verification code is invalid. When few are left, replace all eight. The console has no screen for this on v0.28.0. Send a current code from the app to the API:
curl -X POST http://localhost:3001/api/admin/mfa/backup-codes/regenerate \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"code": "123456"}'The answer holds eight new backup_codes, and the old ones stop working. Use a code from a later window than the one that turned the app on, or the answer is 422 with invalid TOTP code.
5. Add a passkey, with MFA Pro
A passkey, or a security key, can stand in for the code at the second step, or sign in without a password at all. Enrolling one needs MFA Pro, $13 a month, which Growth and Enterprise include.
Console v0.28.0 cannot enroll a passkey. You register one over the API, from a page of your own that calls the browser's navigator.credentials. Without MFA Pro the first call is refused:
curl -X POST http://localhost:3001/api/admin/mfa/webauthn/register/begin \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"code": "123456"}'{"error":"payment_required","feature":"feature:mfa-pro","plugin":"mfa","upgrade_url":""}The answer is 402, and our run without a license stopped there. The rest of this step follows the passkey docs. Once an account holds a factor, adding a passkey takes a current code or a backup code as proof, which is the body above.
Keep the authenticator app as well. The console finishes a sign-in only with an app code or a backup code. A passkey enrolled while the license covered it keeps signing in after the license lapses, because only enrolling one is paid. The same docs section lists the register and sign-in calls.
Turn it off, or reset someone else's
Console v0.28.0
On Two-factor authentication, enter a current code or a backup code in the Code field under Turn off, and choose Turn off. The page then reads Two-factor authentication is off for this account.
Engine API v0.62.0
curl -X POST http://localhost:3001/api/admin/mfa/totp/disable \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"code": "c33f989ba8c3d3b2"}'The answer is 204.
When someone loses both the phone and the codes, a super admin turns their two-factor off over the API, with a reason that is recorded:
curl -X POST http://localhost:3001/api/admin/mfa/admin-reset \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"user_id": "1d0fbdfd-7e59-4cf9-92cc-74d15e563962", "reason": "Lost phone and backup codes, identity checked by phone"}'{"disabled":true,"target_user":"1d0fbdfd-7e59-4cf9-92cc-74d15e563962"}Without reason the answer is 400. Check who is asking before you send it, then have the person turn the app on again from step 1.
When a code or a challenge is refused
The provided verification code is invalid.
The answer is 422. The code was mistyped, or it was already used: LyEve accepts each code once, and the code that turned the app on cannot also sign you in. Wait for the app to show the next one.
The MFA challenge has expired. Please log in again.
The answer is 401. A challenge gives one session and lasts five minutes, so a second mfa-verify with the same challenge_token is refused. Sign in with the password again for a new challenge.
invalid TOTP code when you turn the app on
The answer is 422. The code did not come from the secret this setup issued. Remove the entry from the app, scan the QR code again and send the next code it shows.
What else guards the console
Two-factor sign-in protects one account. Roles and access rules decide what each account may change once it is in. Self-host on a VPS puts the console behind HTTPS, which a password and a code both need on their way to the server.