Skip to content

Commit

Permalink
Introduce interface Icinga\Authentication\User\UserBackendInterface
Browse files Browse the repository at this point in the history
refs #8826
  • Loading branch information
Johannes Meyer committed May 4, 2015
1 parent 870e75c commit 68657c0
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions library/Icinga/Authentication/User/UserBackendInterface.php
@@ -0,0 +1,41 @@
<?php
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */

namespace Icinga\Authentication\User;

use Icinga\Exception\AuthenticationException;
use Icinga\User;

/**
* Interface for user backends
*/
interface UserBackendInterface
{
/**
* Set this backend's name
*
* @param string $name
*
* @return $this
*/
public function setName($name);

/**
* Return this backend's name
*
* @return string
*/
public function getName();

/**
* Authenticate the given user
*
* @param User $user
* @param string $password
*
* @return bool True on success, false on failure
*
* @throws AuthenticationException In case authentication is not possible due to an error
*/
public function authenticate(User $user, $password);
}

0 comments on commit 68657c0

Please sign in to comment.