|
|
|
|
@@ -9,7 +9,7 @@ Two-factor auth providers apps are used to plug custom second factors into the N
|
|
|
|
|
Implementing a simple two-factor auth provider
|
|
|
|
|
----------------------------------------------
|
|
|
|
|
|
|
|
|
|
Two-factor auth providers must implement the ``OCP\Authentication\TwoFactorAuth\IProvider <https://github.com/nextcloud/server/blob/master/lib/public/Authentication/TwoFactorAuth/IProvider.php>``_ interface. The
|
|
|
|
|
Two-factor auth providers must implement the `OCP\\Authentication\\TwoFactorAuth\\IProvider <https://github.com/nextcloud/server/blob/master/lib/public/Authentication/TwoFactorAuth/IProvider.php>`_ interface. The
|
|
|
|
|
example below shows a minimalistic example of such a provider.
|
|
|
|
|
|
|
|
|
|
.. code-block:: php
|
|
|
|
|
@@ -124,7 +124,7 @@ Providing an icon (optional)
|
|
|
|
|
----------------------------
|
|
|
|
|
|
|
|
|
|
To enhance how a provider is shown in the list of selectable providers on the login page, an icon
|
|
|
|
|
can be specified. For that the provider class must implement the ``IProvidesIcons <https://github.com/nextcloud/server/blob/master/lib/public/Authentication/TwoFactorAuth/IProvidesIcons.php>``_
|
|
|
|
|
can be specified. For that the provider class must implement the `IProvidesIcons <https://github.com/nextcloud/server/blob/master/lib/public/Authentication/TwoFactorAuth/IProvidesIcons.php>`_
|
|
|
|
|
interface. The light icon will be used on the login page, whereas the dark one will be placed next
|
|
|
|
|
to the heading of the optional personal settings (see below).
|
|
|
|
|
|
|
|
|
|
@@ -134,7 +134,7 @@ Provide personal settings (optional)
|
|
|
|
|
|
|
|
|
|
Like other Nextcloud apps, two-factor providers often require user configuration to work. In Nextcloud
|
|
|
|
|
15 a new, consolidated two-factor settings section was added. To add personal provider settings there,
|
|
|
|
|
a provider must implement the ``IProvidesPersonalSettings <https://github.com/nextcloud/server/blob/master/lib/public/Authentication/TwoFactorAuth/IProvidesPersonalSettings.php>``_
|
|
|
|
|
a provider must implement the `IProvidesPersonalSettings <https://github.com/nextcloud/server/blob/master/lib/public/Authentication/TwoFactorAuth/IProvidesPersonalSettings.php>`_
|
|
|
|
|
interface.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -142,7 +142,7 @@ Make a provider activatable by the admin (optional)
|
|
|
|
|
---------------------------------------------------
|
|
|
|
|
|
|
|
|
|
In order to make it possible for an admin to enable the provider for a given user via the occ
|
|
|
|
|
command line tool, it's necessary to implement the ``OCP\Authentication\TwoFactorAuth\IActivatableByAdmin <https://github.com/nextcloud/server/blob/master/lib/public/Authentication/TwoFactorAuth/IActivatableByAdmin.php>``_
|
|
|
|
|
command line tool, it's necessary to implement the `OCP\\Authentication\\TwoFactorAuth\\IActivatableByAdmin <https://github.com/nextcloud/server/blob/master/lib/public/Authentication/TwoFactorAuth/IActivatableByAdmin.php>`_
|
|
|
|
|
interface. As described in the linked interface documentation, this should only be implemented
|
|
|
|
|
for providers that need no user interaction when activated.
|
|
|
|
|
|
|
|
|
|
@@ -151,6 +151,6 @@ Make a provider deactivatable by the admin (optional)
|
|
|
|
|
-----------------------------------------------------
|
|
|
|
|
|
|
|
|
|
In order to make it possible for an admin to disable the provider for a given user via the occ
|
|
|
|
|
command line tool, it's necessary to implement the ``OCP\Authentication\TwoFactorAuth\IDeactivatableByAdmin <https://github.com/nextcloud/server/blob/master/lib/public/Authentication/TwoFactorAuth/IDeactivatableByAdmin.php>``_
|
|
|
|
|
command line tool, it's necessary to implement the `OCP\\Authentication\\TwoFactorAuth\\IDeactivatableByAdmin <https://github.com/nextcloud/server/blob/master/lib/public/Authentication/TwoFactorAuth/IDeactivatableByAdmin.php>`_
|
|
|
|
|
interface. As described in the linked interface documentation, this should only be implemented
|
|
|
|
|
for providers that need no user interaction when deactivated.
|
|
|
|
|
for providers that need no user interaction when deactivated.
|
|
|
|
|
|