* @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2 * @author Icinga Development Team * */ // {{{ICINGA_LICENSE_HEADER}}}} namespace Icinga\Authentication; use \Zend_Config; use \Icinga\User; use Icinga\Authentication\Credential; /** * Public api for an user backend object */ interface UserBackend { /** * Test if the username exists * * @param Credential $credentials * * @return bool */ public function hasUsername(Credential $credentials); /** * Authenticate * * @param Credential $credentials * * @return User */ public function authenticate(Credential $credentials); /** * Name of the backend * * @return string */ public function getName(); /** * Get the number of users available through this backend * * @return int */ public function getUserCount(); /** * Establish the connection to this authentication backend * * @throws ConfigurationError When the backend is not reachable with the given configuration. */ public function connect(); }