summaryrefslogtreecommitdiff
path: root/doc/plugin-authentication.markdown
diff options
context:
space:
mode:
authorGerardo Zamudio <gerardozamudio@users.noreply.github.com>2016-02-24 23:48:50 -0600
committerGerardo Zamudio <gerardozamudio@users.noreply.github.com>2016-02-24 23:48:50 -0600
commite4de6b3898b64b26d29aff31f21df5fda8055686 (patch)
tree575f8a65440f291d70a070d168eafca8c82a6459 /doc/plugin-authentication.markdown
parentd9ffbea174ea6524d0a22f8375ca8b3aa04a3c96 (diff)
parenta6540bc604c837d92c9368540c145606723e97f7 (diff)
Merge pull request #1 from fguillot/master
Update from upstream
Diffstat (limited to 'doc/plugin-authentication.markdown')
-rw-r--r--doc/plugin-authentication.markdown40
1 files changed, 40 insertions, 0 deletions
diff --git a/doc/plugin-authentication.markdown b/doc/plugin-authentication.markdown
new file mode 100644
index 00000000..06fdfd8d
--- /dev/null
+++ b/doc/plugin-authentication.markdown
@@ -0,0 +1,40 @@
+Authentication Plugin
+=====================
+
+New authentication backends can be written with very few lines of code.
+
+Provider Registration
+---------------------
+
+In the method `initialize()` of your plugin, call the method `register()` of the class `AuthenticationManager`:
+
+```php
+public function initialize()
+{
+ $this->authenticationManager->register(new ReverseProxyLdapAuth($this->container));
+}
+```
+
+The object provided to the method `register()` must implement one of the pre-defined authentication interfaces.
+
+Those interfaces are defined in the namepsace `Kanboard\Core\Security`:
+
+- `Kanboard\Core\Security\PreAuthenticationProviderInterface`
+- `Kanboard\Core\Security\PostAuthenticationProviderInterface`
+- `Kanboard\Core\Security\PasswordAuthenticationProviderInterface`
+- `Kanboard\Core\Security\OAuthAuthenticationProviderInterface`
+
+The only requirement is to implement the interfaces, you class can be written the way you want and located anywhere on the disk.
+
+User Provider
+-------------
+
+When the authentication is successful, your driver must return an object that represents the user.
+This object must implement the interface `Kanboard\Core\User\UserProviderInterface`.
+
+Example of authentication plugins
+---------------------------------
+
+- [Authentication providers included in Kanboard](https://github.com/fguillot/kanboard/tree/master/app/Auth)
+- [Reverse-Proxy Authentication with LDAP support](https://github.com/kanboard/plugin-reverse-proxy-ldap)
+- [SMS Two-Factor Authentication](https://github.com/kanboard/plugin-sms-2fa)