diff --git a/www/auth/login.php b/www/auth/login.php
index 0a468950a8698d611926d35385ed8625346b2611..4e106a8986d6bfb1df8875857af9e5dc2c5687a2 100644
--- a/www/auth/login.php
+++ b/www/auth/login.php
@@ -48,7 +48,8 @@ if (isset($_POST['username'])) {
 		}
 		*/
 		if (!ldap_bind($ds, $dn, $pwd)) {
-			$error = "Bind failed, wrong username or password. Tried with DN=[" . $dn . "] DNPattern=[" . $config->getValue('auth.ldap.dnpattern') . "]";
+			$error = "Bind failed, wrong username or password. Tried with DN=[" . $dn . "] DNPattern=[" . $config->getValue('auth.ldap.dnpattern')
+				. "] Error=[" . ldap_error($ds) . "] ErrNo=[" . ldap_errno($ds) . "]";
 			
 			$logger->log(LOG_NOTICE, $session->getTrackID(), 'AUTH', 'ldap', 'Fail', $_POST['username'], $_POST['username'] . ' failed to authenticate');