diff --git a/developer_manual/app/index.rst b/developer_manual/app/index.rst index 75d3d0efd..92af52765 100644 --- a/developer_manual/app/index.rst +++ b/developer_manual/app/index.rst @@ -28,11 +28,13 @@ configuration filesystem users + two-factor-provider hooks backgroundjobs logging testing publishing + code_signing =============== App Development @@ -115,6 +117,10 @@ Creating, deleting, updating, searching, login and logout: * :doc:`users` +Writing a two-factor auth provider: + +* :doc:`two-factor-provider` + Hooks ----- Listen on events like user creation and execute code: diff --git a/developer_manual/app/two-factor-provider.rst b/developer_manual/app/two-factor-provider.rst new file mode 100644 index 000000000..30add5344 --- /dev/null +++ b/developer_manual/app/two-factor-provider.rst @@ -0,0 +1,105 @@ +==================== +Two-factor Providers +==================== + +.. sectionauthor:: Christoph Wurst + +Two-factor auth providers apps are used to plug custom second factors into the ownCloud core. The following +code was taken from the `two-factor test app`_. + +.. _`two-factor test app`: https://github.com/ChristophWurst/twofactor_test + +Implementing a simple two-factor auth provider +============================================== +Two-factor auth providers must implement the ``OCP\Authentication\TwoFactorAuth\IProvider`` interface. The +example below shows a minimalistic example of such a provider. + +.. code-block:: php + + + OCA\TwoFactor_Test\Provider\TwoFactorTestProvider +