Skip to content

Commit d03f6f4

Browse files
authored
Merge pull request #12446 from nextcloud/jtr/admin-refactor-2fa
refactor(admin): 2FA chapter clean-up
2 parents 97e0715 + 87d003b commit d03f6f4

File tree

1 file changed

+57
-31
lines changed

1 file changed

+57
-31
lines changed

admin_manual/configuration_user/two_factor-auth.rst

Lines changed: 57 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,57 +5,64 @@ Two-factor authentication
55
=========================
66

77
Two-factor authentication adds an additional layer of security to user accounts. In order to log
8-
in on an account with two-factor authentication (2FA) enabled, it is necessary to provide both the
9-
login password and another factor. 2FA in Nextcloud is pluggable, meaning that they are not part
10-
of the Nextcloud Server component but provided by featured and 3rd-party Nextcloud apps.
8+
in on an account when two-factor authentication (2FA) enabled, you must provide both the
9+
login password and another factor.
1110

11+
To use 2FA two things must happen:
1212

13-
Several 2FA apps are already available including
14-
`TOTP <https://en.wikipedia.org/wiki/Time-based_One-time_Password_Algorithm>`_,
15-
a Telegram/Signal/SMS gateway and `U2F <https://en.wikipedia.org/wiki/Universal_2nd_Factor>`_.
13+
- At least one 2FA provider must be enabled by the administrator.
14+
- A user must activate 2FA on their account (or) the administrator must enforce the use of 2FA.
1615

17-
18-
Developers can `build new two-factor provider apps <https://docs.nextcloud.com/server/latest/developer_manual/digging_deeper/two-factor-provider.html>`_.
19-
20-
.. TODO ON RELEASE: Update version number above on release
16+
Both steps are described below.
2117

2218
Enabling two-factor authentication
2319
----------------------------------
2420

25-
You can enable 2FA by installing and enabling a 2FA app like TOTP which works
26-
with Google Authenticator and compatible apps. The apps are available in the
27-
Nextcloud App store so by navigating there and clicking **enable** for the app
28-
you want, 2FA will be installed and enabled on your Nextcloud server.
21+
2FA in Nextcloud is pluggable, meaning that various 2FA providers can be used to support different
22+
types of factors. Three providers are automatically installed (but may need to be enabled):
2923

30-
.. figure:: ../images/2fa-app-install.png
24+
**Two-Factor TOTP Provider**
3125

32-
Once 2FA has been enabled, users have to `activate it in their personal settings. <https://docs.nextcloud.com/server/latest/user_manual/en/user_2fa.html>`_
26+
- A 2FA factor provider that enables the use of a `TOTP <https://en.wikipedia.org/wiki/Time-based_One-time_Password_Algorithm>`_
27+
(RFC 6238) app installed on a phone (or other device) to be used as the secondary factor
28+
- Compatible with any RFC 6238 compliant TOTP client app (such as `Aegis <https://github.com/beemdevelopment/aegis>`_ or Google Authenticator).
29+
- Disabled by default. Go to *Apps->Disabled apps* and find *Two-Factor TOTP Provider* to enable this factor.
3330

34-
.. TODO ON RELEASE: Update version number above on release
31+
**Two-Factor Authentication via Nextcloud notifications**
3532

36-
Disabling two-factor authentication
37-
-----------------------------------
33+
- A 2FA factor provider that enables the use of a logged in device as the secondary factor.
34+
- Disabled by default. Go to *Apps->Disabled apps* and find *Two-Factor Authentication via Nextcloud
35+
notification* to enable this factor.
3836

39-
Two-factor providers can be disabled via :ref:`occ <occ>`::
37+
**Two-Factor Backup Codes**
4038

41-
sudo -u www-data php occ twofactorauth:disable <uid> <provider_id>
39+
- A special 2FA factor provider enables users to generate backup codes provider.
40+
- Facilitates recovery of access if a a 2FA device is unavailable (i.e. gets stolen or is not working).
41+
- Generates ten backup codes (which can, of course, only be use once).
42+
- Always enabled.
4243

43-
User are free to enable this provider again via their personal settings.
44+
Other 2FA providers may be found in the App Store.
4445

45-
.. note:: This operation has to be supported by the provider. If this support is missing, Nextcloud will abort and show an error.
46+
.. TODO ON RELEASE: Update version number above on release
47+
48+
.. figure:: ../images/2fa-app-install.png
49+
50+
Developers can also `implement new two-factor provider
51+
apps <https://docs.nextcloud.com/server/latest/developer_manual/digging_deeper/two-factor-provider.html>`_.
52+
53+
.. TODO ON RELEASE: Update version number above on release
4654
4755
Enforcing two-factor authentication
4856
-----------------------------------
4957

5058
By default 2FA is *optional*, hence users are given the choice whether to enable
51-
it for their account. Admins may enforce the use of 2FA.
59+
it for their account `under their personal settings <https://docs.nextcloud.com/server/latest/user_manual/en/user_2fa.html>`_.
60+
Admins may, however, enforce the use of 2FA.
5261

62+
Enforcement is possible system-wide (all users) or for selected groups only. Select groups
63+
can also be excluded from 2FA requirements.
5364

54-
Enforcement is possible system-wide (all users), for selected groups only and can
55-
also be excluded for certain groups.
56-
57-
58-
These settings can be found in the administrator's security settings.
65+
These settings can be found under *Administration Settings->Security*.
5966

6067
.. figure:: ../images/2fa-admin-settings.png
6168

@@ -69,10 +76,29 @@ a user has 2FA enforced:
6976
Provider removal
7077
----------------
7178

72-
Nextcloud keeps records about the enabled two-factor authentication providers of every user. If a provider is simply removed/:ref:`disabled <apps_commands_label>`, Nextcloud will still consider the provider active for the user at login and show a warning like *Could not load at least one of your enabled two-factor auth methods*.
79+
Nextcloud keeps records about the enabled two-factor authentication providers of every user.
80+
If a provider is simply removed/:ref:`disabled <apps_commands_label>`,
81+
Nextcloud will still consider the provider active for the user at login and show a warning like *Could not load at least one of your enabled two-factor auth methods*.
7382

7483
The associations of removed providers can be cleaned up via :ref:`occ <occ>`::
7584

7685
sudo -u www-data php occ twofactorauth:cleanup <provider_id>
7786

78-
.. warning:: This operation is irreversible. Only run it for providers you do not intend to enable again.
87+
.. warning:: This operation is irreversible. Only run it for providers you do not intend to enable again as then you have to setup the configuration for all users from scratch.
88+
89+
90+
Disabling two-factor authentication
91+
-----------------------------------
92+
93+
Two-factor providers can be disabled via :ref:`occ <occ>`::
94+
95+
sudo -u www-data php occ twofactorauth:disable <uid> <provider_id>
96+
97+
This can be useful if the user forgot or lost their second factor.
98+
Afterwards users are free to enable this provider again via their personal settings.
99+
100+
.. note:: This operation has to be supported by the provider. If this support is missing, Nextcloud will abort and show an error.
101+
102+
It is also possible to check the current two-factor user status via :ref:`occ <occ>`::
103+
104+
sudo -u www-data php occ twofactorauth:state <uid>

0 commit comments

Comments
 (0)