5 use Adldap\Connections\ConnectionInterface
;
6 use Adldap\Configuration\DomainConfiguration
;
8 interface GuardInterface
13 * @param ConnectionInterface $connection
14 * @param DomainConfiguration $configuration
16 public function __construct(ConnectionInterface
$connection, DomainConfiguration
$configuration);
19 * Authenticates a user using the specified credentials.
21 * @param string $username The users AD username.
22 * @param string $password The users AD password.
23 * @param bool $bindAsUser Whether or not to bind as the user.
25 * @throws \Adldap\Auth\BindException When re-binding to your LDAP server fails.
26 * @throws \Adldap\Auth\UsernameRequiredException When username is empty.
27 * @throws \Adldap\Auth\PasswordRequiredException When password is empty.
31 public function attempt($username, $password, $bindAsUser = false);
34 * Binds to the current connection using the inserted credentials.
36 * @param string $username
37 * @param string $password
38 * @param string $prefix
39 * @param string $suffix
41 * @throws \Adldap\Auth\BindException When binding to your LDAP server fails.
45 public function bind($username, $password, $prefix = null, $suffix = null);
48 * Binds to the current LDAP server using the
49 * configuration administrator credentials.
51 * @throws \Adldap\Auth\BindException When binding as your administrator account fails.
55 public function bindAsAdministrator();