Table of Contents

Pair an account with two-factor authentication (TOTP)

Each user turns two-factor authentication on for their own account, from the CMS. This page describes the LocalTotp provider; configure it first as in Two-factor authentication — Configure LocalTotp.

Note

Before MIB 7.0 this was done on the Authorization Server's own profile page (/Account). That page is deprecated; use the CMS Account page described here.

Turn it on

  1. Open the avatar menu (top right) → Manage account. The Lock Service section is there when the lock server is enabled; its two-factor authentication field is there when the TOTP operation is enabled.

  2. Switch two-factor authentication on. The CMS shows a QR code for this account.

  3. Scan it with any authenticator app. The new entry shows the issuer (the LockServer.Issuer key, default Agile Tv) and the username:

    An authenticator app entry for MIB

  4. Type the code the app shows to confirm. The QR code's secret is stored on the user as soon as the code is first generated; the pairing is completed only when the code you type validates.

From the next sign-in on, the user is asked for a code after the password — see Sign in with two-factor authentication.

Turn it off

Switch two-factor authentication off on the Account page and save. The pairing is removed, so the next sign-in asks for the password only, and turning 2FA on again shows a new QR code.

What is stored

The pairing lives on the user's ADM_USERS row:

Column Meaning
LOCK_TOTP_ENABLED 2FA is on for this user.
LOCK_TOTP_ID The pairing id. Set when the QR code is first generated.
LOCK_TOTP_SECRET The TOTP secret the QR code carries (LocalTotp).
LOCK_TOTP_LASTTIMESTEP The last time step a code was accepted for, so a code cannot be used twice.

A sign-in asks for the code when the lock server is enabled, the TOTP operation is enabled, LOCK_TOTP_ENABLED is set and the user has a LOCK_TOTP_ID.

Important

The CMS user page has no two-factor control: administrators cannot pair or reset another user's 2FA there. A user who lost their authenticator has to be reset on their ADM_USERS row — clear LOCK_TOTP_ENABLED, LOCK_TOTP_ID, LOCK_TOTP_SECRET and LOCK_TOTP_LASTTIMESTEP — and then pairs again from the Account page.

Under the hood

The Account page calls the BFF (/api/v2/account/lock-server/2fa/{userId}, its /qrcode, and /api/v2/account/lockserver/totp/{userId}/pair / /validate), which forwards to the Authorization Server's /api/v2/account/lockserver/totp/{userId}/… endpoints. The QR code is an otpauth://totp URI (SHA-1, 30-second step) for the account name and the configured issuer.