summaryrefslogtreecommitdiff
path: root/doc/plugin-authentication.markdown
blob: 30ccda7c2dc27720b8ac45d8d4d217295cde8ed6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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 disk.

User Provider
-------------

When the authentication is successful, your driver must return an object that represent the user.
This object must implements 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)