Table of Contents
Kanboard provides a flexible and pluggable authentication architecture.
By default, user authentication can be done with multiple methods:
More over, after a successful authentication, a Two-Factor post authentication can be done. Kanboard supports natively the TOTP standard.
To have a pluggable system, authentication drivers must implement a set of interfaces:
Interface | Role |
---|---|
AuthenticationProviderInterface | Base interface for other authentication interfaces |
PreAuthenticationProviderInterface | The user is already authenticated when reaching the application, web servers usually define some environment variables |
PasswordAuthenticationProviderInterface | Authentication methods that uses the username and password provided in the login form |
OAuthAuthenticationProviderInterface | OAuth2 providers |
PostAuthenticationProviderInterface | Two-Factor auhentication drivers, ask for confirmation code |
SessionCheckProviderInterface | Providers that are able to check if the user session is valid |
PasswordAuthenticationProviderInterface
and SessionCheckProviderInterface
PreAuthenticationProviderInterface
and SessionCheckProviderInterface
OAuthAuthenticationProviderInterface
PasswordAuthenticationProviderInterface
PreAuthenticationProviderInterface
PostAuthenticationProviderInterface
For each HTTP request:
SessionCheckProviderInterface
PreAuthenticationProviderInterface
PasswordAuthenticationProviderInterface
are executedPostAuthenticationProviderInterface
will be usedThis workflow is managed by the class Kanboard\Core\Security\AuthenticationManager
.
Events triggered:
AuthenticationManager::EVENT_SUCCESS
: Successful authenticationAuthenticationManager::EVENT_FAILURE
: Failed authenticationEach time a failure event occurs, the counter of failed logins is incremented.
The user account can be locked down for the configured period of time and a captcha can be shown to avoid brute force attacks.
When the authentication is successful, the AuthenticationManager
will ask the user information to your driver by calling the method getUser()
. This method must return an object that implements the interface Kanboard\Core\User\UserProviderInterface
.
This class abstract the information gathered from another system.
Examples:
DatabaseUserProvider
provides information for an internal userLdapUserProvider
for a LDAP userReverseProxyUserProvider
for a Reverse-Proxy userGoogleUserProvider
represents a Google userMethods for User Provider Interface:
isUserCreationAllowed()
: Return true to allow automatic user creationgetExternalIdColumn()
: Get external ID column name (google_id
, github_id
, gitlab_id
…)getInternalId()
: Get internal database IDgetExternalId()
: Get external ID (Unique ID)getRole()
: Get user rolegetUsername()
: Get usernamegetName()
: Get user full namegetEmail()
: Get user email addressgetExternalGroupIds()
: Get external group ids, automatically sync group membership if presentgetExtraAttributes()
: Get extra attributes to set for the user during the local syncIt’s not mandatory to return a value for each method.
User information can be automatically synced with the local database.
getInternalId()
return a value no synchronization is performedgetExternalIdColumn()
and getExternalId()
must return a value to sync the user