Enforce two-factor authentication
Require a second factor at sign-in for administrators or for every local account, and deactivate a user's lost factor.
Enforce two-factor authentication so users who sign in with a Servicely password also enter a code from an authenticator app. This task is for administrators. It covers local accounts only: single sign-on and LDAP users rely on their identity provider.
Before you begin
- You need
administrator. - Tell users before you enforce it. They need an authenticator app that follows the Google Authenticator standard, such as Google Authenticator, Microsoft Authenticator or Authy.
- Decide who must use it. Two application properties set the scope, and nothing else does: there is no per-role, per-group or per-user setting.
...2fa.enforced |
...2fa.enforced.admin_only |
Who must use two-factor authentication |
|---|---|---|
| false | true | Holders of administrator. This is the shipped setting on production instances. |
| true | either | Every local account |
| false | false | Nobody |
The full names are system.security.local.account.2fa.enforced (default false) and system.security.local.account.2fa.enforced.admin_only (default true).
Steps
-
Go to Application → Application → Application properties.
-
Search for
2fato find the two properties. -
To enforce it for every local account, set
system.security.local.account.2fa.enforcedto true. -
To enforce it for administrators only, leave
system.security.local.account.2fa.enforcedfalse and setsystem.security.local.account.2fa.enforced.admin_onlyto true. -
Save each property you changed.
Result
At their next sign-in, each user in scope enters their password and then sees a QR code. They scan it with their authenticator app and enter the one-time code to finish enrolment. From then on they enter a code after their password. The steps users follow are in Set up two-factor authentication in the End-user guide.
These rules apply:
- A user has one active factor, so one device.
- The code step must be completed within 4 minutes.
- Three wrong codes end the attempt and add to the user’s failed sign-in count.
- API access with a local account is not affected.
Factors are listed under Administration → Authentication → User Second Authentication Factors. A factor is Verified once it has been used to sign in. An unverified factor belongs to a user who started enrolment and did not finish it.
Variations
Deactivate a user’s factor
Do this when a user loses the device with their authenticator app. A deactivated factor cannot be used again.
-
Go to Administration → Authentication → User Second Authentication Factors and open the user’s factor.
-
Select Deactivate, enter the Deactivation Reason and confirm.
At their next sign-in, the user enrols a new factor. Nobody can create or delete a factor record by hand.