Two-step sign-in for public staff
This page is for administrators and project managers who must introduce multi-factor authentication for the staff
who edit a public site. Exponential's two-step sign-in is provided by the extension sevenx_authentication_2fa, which
composer.json requires and the installers activate; it is opt-in until you require it
(Two-step sign-in).
Contents
- What staff experience
- Turning it on
- Requiring it
- Rolling it out
- Lost phone and other support cases
- What protects it
- Related pages
What staff experience
- Sign in with username and password as before.
- A page asks for a 6-digit code: from an authenticator app, or from an e-mail.
- Set up under My account > Two-step sign-in (
/user2fa/setup): scan the QR code, enter one code to confirm. - Changing the method or turning it off asks for a current code.
Turning it on
In settings/override/site.ini.append.php, with the extension active, put the login handler before standard:
[UserSettings]
LoginHandler[]
LoginHandler[]=sevenxUser2fa
LoginHandler[]=standardThen:
- add a class attribute of the datatype 7x 2FA Configuration (for example identifier
two_factor) to the user class; - give every role that signs in the policies
user2fa/setupanduser2fa/verify; - set an encryption key for the authenticator secrets in
settings/override/sevenxauthentication2fa.ini.append.php:[TOTPSettings] SecretKey=<output of: openssl rand -base64 48>(losing it means everyone sets the app up again); - clear the caches and deploy:
./console exp:velocity deploy --allow-root-useron Velocity.
Try it first on a test siteaccess, as the guide describes.
Requiring it
[General] Enforce2FA | DefaultMethod | Effect |
|---|---|---|
disabled (default) | any | users opt in |
enabled | totp | a user without a second step sets up the app right after the password |
enabled | email | a user without a second step gets e-mail codes at once |
Set it in settings/override/sevenxauthentication2fa.ini.append.php, then php bin/php/ezcache.php --clear-tag=ini
and deploy. Enforce2FA applies to every account that signs in through the handler.
Rolling it out
- Enrol the administrators first, so nobody is caught without a phone.
- Announce the date to editors with a one-page instruction and the support contact.
- Offer opt-in for two weeks; then set
Enforce2FA=enabled. - A role created later needs
user2fa/setupanduser2fa/verifyfor its users. - Check accounts on their account page: a hint shows when two-step sign-in is off (Security and audit, 6).
Lost phone and other support cases
- An administrator opens the user's object, sets the Two-step sign-in field to E-mail one-time code or Disabled, and publishes; the user signs in and sets the app up again.
- Wrong codes count as failed logins of the account; with
MaxNumberOfFailedLoginset, they can lock it. - Every step is written to
var/log/auth.log(never a code or a secret), readable under Setup > Log files.
What protects it
The password alone never signs in; the session gets a new id after the code; each code works once; e-mail codes are stored hashed and rate limited; the QR code is drawn on the server and the key goes to no other service; redirects pass the safe redirect rules (Two-step sign-in: What protects it). Social login buttons, if enabled, involve third-party identity providers (see the privacy section of this help).
Related pages
- Two-step sign-in
- Two-factor sign-in for hosts
- sevenx_authentication_2fa
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.