---
title: "Enforce two-factor authentication"
site: admin
version: 1.11
versions: "all"
url: https://docs-new.servicely.ai/admin/1.11/access/two-factor-authentication/
type: task
application: sso
last_updated: 2026-11-24
commit: 88e011e506a8
---


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

<Steps>
  <Step>
    Go to **Application → Application → Application properties**.
  </Step>
  <Step>
    Search for `2fa` to find the two properties.
  </Step>
  <Step>
    To enforce it for every local account, set `system.security.local.account.2fa.enforced` to true.
  </Step>
  <Step>
    To enforce it for administrators only, leave `system.security.local.account.2fa.enforced` false and set `system.security.local.account.2fa.enforced.admin_only` to true.
  </Step>
  <Step>
    Save each property you changed.
  </Step>
</Steps>

## 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](page:end-user/employees/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.

<Steps>
  <Step>
    Go to **Administration → Authentication → User Second Authentication Factors** and open the user's factor.
  </Step>
  <Step>
    Select **Deactivate**, enter the **Deactivation Reason** and confirm.
  </Step>
</Steps>

At their next sign-in, the user enrols a new factor. Nobody can create or delete a factor record by hand.


## Related

- [Security application properties](page:access/security-properties)
- [Set up two-factor authentication](page:end-user/employees/set-up-two-factor-authentication)
- [Set up single sign-on with Microsoft Entra ID](page:access/sso-microsoft-entra-id)
