summaryrefslogtreecommitdiff
path: root/app/Auth
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-03-27 18:30:02 -0400
committerFrederic Guillot <fred@kanboard.net>2016-03-27 18:30:02 -0400
commitd0a0be89f2a774e5438fe844d69541fecb5cafc4 (patch)
tree2f0738c4e49f41f00e74fa80dc69efa2de4d2c26 /app/Auth
parentcefeb7ef96902f4c75936bccc0cd72258ef0d7d6 (diff)
Added more logging for LDAP client
Diffstat (limited to 'app/Auth')
-rw-r--r--app/Auth/LdapAuth.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/Auth/LdapAuth.php b/app/Auth/LdapAuth.php
index b4efbb55..c9423580 100644
--- a/app/Auth/LdapAuth.php
+++ b/app/Auth/LdapAuth.php
@@ -63,10 +63,12 @@ class LdapAuth extends Base implements PasswordAuthenticationProviderInterface
try {
$client = LdapClient::connect($this->getLdapUsername(), $this->getLdapPassword());
+ $client->setLogger($this->logger);
+
$user = LdapUser::getUser($client, $this->username);
if ($user === null) {
- $this->logger->info('User not found in LDAP server');
+ $this->logger->info('User ('.$this->username.') not found in LDAP server');
return false;
}
@@ -74,6 +76,8 @@ class LdapAuth extends Base implements PasswordAuthenticationProviderInterface
throw new LogicException('Username not found in LDAP profile, check the parameter LDAP_USER_ATTRIBUTE_USERNAME');
}
+ $this->logger->info('Authenticate user: '.$user->getDn());
+
if ($client->authenticate($user->getDn(), $this->password)) {
$this->userInfo = $user;
return true;