Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.
 

Issue with LDAP authentication


#1

Hi,

I am trying to authenticate TestRail v5.6.0.3861 into my LDAP and I always have “External auth: Bind: Can’t contact LDAP server (failed to retrieve user object)” error.

Here is my auth.php configuration:

define(‘AUTH_HOST’, ‘ldap://myserver.mydomain’);
define(‘AUTH_PORT’, 10389);
define(‘AUTH_BIND_DN’, ‘’);
define(‘AUTH_BIND_PASSWORD’, ‘’);
define(‘AUTH_DN’, ‘ou=Users,dc=MyDomain,dc=fr’);
define(‘AUTH_FILTER’, ‘(&(objectClass=inetOrgPerson)(cn=%name%))’);
define(‘AUTH_FALLBACK’, true);
define(‘AUTH_CREATE_ACCOUNT’, false);
define(‘AUTH_NAME_ATTRIBUTE’, ‘displayName’);
define(‘AUTH_MAIL_ATTRIBUTE’, ‘mail’);

My LDAP server is an Apache Directory Server listening on port 10389 and browsable anonymously.
I have replaced the real AUTH_DN here and the server name. But when I try with a non existent server name, I have another error. So I guess TestRail can reach the LDAP server.

Here is my log:

[E] 2019-01-30 09:44:39 [225ms]: [AuthException] Bind: Can’t contact LDAP server (failed to retrieve user object)

Details:
File: /USR/testrail/apache/htdocs/www-testrail-443/custom/auth/auth.php
Line: 127
Status Code: 500
Host: testrail.mydomain.fr
Uri: /index.php?/auth/login/ (POST)

Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0
PHP: 7.2.10
Server: Linux 3.10.0-862.14.4.el7.x86_64 #1 SMP Wed Sep 26 15:12:11 UTC 2018 x86_64

name: plejeune
password:
rememberme: 1

Trace:
at authenticate_user (custom.php:261)
at Auth_custom_driver->_login (custom.php:305)
at Auth_custom_driver->login (auth.php:628)
at Auth_library->_login_custom (auth.php:616)
at Auth_library->_login (auth.php:518)
at Auth_library->login (auth.php:61)
at Auth_controller->login (controller.php:257)
at Controller->_invoke_web_call (controller.php:168)
at Controller->_invoke_web (controller.php:120)
at Controller->_invoke (gizmo.php:107)
at require_once (index.php:106)

[E] 2019-01-30 09:44:39 [232ms]: [AuthException] External auth: Bind: Can’t contact LDAP server (failed to retrieve user object)

Details:
File: /USR/testrail/apache/htdocs/www-testrail-443/sys/helpers/ex.php
Line: 25
Status Code: 500
Host: testrail.mydomain.fr
Uri: /index.php?/auth/login/ (POST)

Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0
PHP: 7.2.10
Server: Linux 3.10.0-862.14.4.el7.x86_64 #1 SMP Wed Sep 26 15:12:11 UTC 2018 x86_64

name: plejeune
password:
rememberme: 1

Trace:
at ex::raise (ex.php:43)
at ex::raisev (ex.php:73)
at ex::raiset (custom.php:270)
at Auth_custom_driver->_login (custom.php:305)
at Auth_custom_driver->login (auth.php:628)
at Auth_library->_login_custom (auth.php:616)
at Auth_library->_login (auth.php:518)
at Auth_library->login (auth.php:61)
at Auth_controller->login (controller.php:257)
at Controller->_invoke_web_call (controller.php:168)
at Controller->_invoke_web (controller.php:120)
at Controller->_invoke (gizmo.php:107)
at require_once (index.php:106)

Any idea?


#2

Hi Pierre,

Just wanted to let you know that I have responded to your request via contact@gurock.com on this matter where we can discuss sensitive details like this more freely.