Recently, we at FrogSlayer decided to give TestLink a try to help with our QA process. As with most of our internal tools, LDAP authentication is always a must. I began the task of searching through the user manual from Joomla! and various online resources on how to configure TestLink to utilize LDAP. Little did I know that I would be banging my head against this issue for a few hours.
TestLink’s LDAP bind implementation
The way in which TestLink implements LDAP authentication is a little divergent from some other tools such as ownCloud. In the case of ownCloud, the users database is populated once an LDAP binding is successfully established. In the case of TestLink, the users must be created in the TestLink database first before their LDAP password will authenticate them. I STRESS AGAIN: users must be manually entered into the TestLink database (which can be done via a local admin account). I will detail the steps I took to get LDAP authentication working with TestLink.
The Initial Install
The initial install of TestLink is pretty straightforward. The administration manual covers most of what you will need in the initial setup of TestLink. When rolling your own configuration file, you will want to be sure to utilize the custom_config.inc.php.example file. Copy the file and rename it to custom_config.inc.php. The settings that you write in this config file will overwrite the configuration of the config.inc.php. The administration manual says (and the comments in the config.inc.php file indicate) that you should use the custom config file to make life easier when you upgrade at some point. It is in this custom configuration file that you will insert the LDAP settings information. The only “gotcha” moments during the TestLink setup were setting up the log_path and repositoryPath variable. You will want to update these variables in the custom configuration file in the following format (of course updating the path to reflect your deploy point):
$tlCfg->log_path = '\testlink\logs'; $g_repositoryPath = '\testlink\upload_area';
After setup completes, you will be notified to update email configuration settings as well and delete the install directory. Below I list the configuration that was necessary for my setup (again editing the custom configuration file):
$g_smtp_host = 'some smtp server'; $g_tl_admin_email = 'email@example.com'; $g_from_email = 'firstname.lastname@example.org'; $g_return_path_email = 'email@example.com';
Before configuring the LDAP settings in the custom configuration file, it is important to note that you should have created a custom account via the user administration section of TestLink that reflects a user in the domain (Remember: users must exist in the TestLink database before LDAP can be used to authenticate). For example, in my setup, I created a new user with identical credentials to that stored in LDAP (username and password) for my own user account. In theory when you change the authentication method to “LDAP” in the custom configuration file, TestLink will know that passwords are managed by the LDAP connection, rather than the TestLink database.
Below is a copy of the configuration that finally worked for me. (Note x’s have replaced the info you will want to put in based on your domain structure).
$tlCfg->authentication['method'] = 'LDAP'; $tlCfg->authentication['ldap_server'] = 'xxx.xxx.xx.xxx'; $tlCfg->authentication['ldap_port'] = 'xxx'; $tlCfg->authentication['ldap_version'] = '3'; $tlCfg->authentication['ldap_root_dn'] = 'dc=business,dc=xxx'; $tlCfg->authentication['ldap_uid_field'] = 'sAMAccountName'; $tlCfg->authentication['ldap_bind_dn'] = 'firstname.lastname@example.org'; $tlCfg->authentication['ldap_bind_passwd'] = 'password';
/** Enable/disable Users to create accounts on login page */
$tlCfg->user_self_signup = FALSE;
And that’s all folks!
That should be all that is necessary to establish the LDAP bind for use with TestLink. You will also note that I disabled user_self_signup in my configuration. Upon logging in for the first time with my own credentials, I was able to create the other users I needed to get us going. Good luck with your TestLink adventures!
BlogSlayer is the official blog of FrogSlayer, a custom software product development shop in Bryan/College Station, Texas. Our specialty is getting your product to market in 90 days or less. If you would like a free consultation for your project or big idea, email us at email@example.com. You can also connect with us on Twitter, Facebook, or LinkedIn.