composer package updates
[openemr.git] / vendor / adldap2 / adldap2 / src / Auth / GuardInterface.php
blob649a99ca7b873d916ab274092c61c5570f76784e
1 <?php
3 namespace Adldap\Auth;
5 use Adldap\Connections\ConnectionInterface;
6 use Adldap\Configuration\DomainConfiguration;
8 interface GuardInterface
10 /**
11 * Constructor.
13 * @param ConnectionInterface $connection
14 * @param DomainConfiguration $configuration
16 public function __construct(ConnectionInterface $connection, DomainConfiguration $configuration);
18 /**
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.
29 * @return bool
31 public function attempt($username, $password, $bindAsUser = false);
33 /**
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.
43 * @return void
45 public function bind($username, $password, $prefix = null, $suffix = null);
47 /**
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.
53 * @return void
55 public function bindAsAdministrator();