trouble setting parameters for LDAP integration

The release related discussions, plans and questions.
Locked
ls86
TestLink user
Posts: 2
Joined: Tue Nov 11, 2008 7:11 am

trouble setting parameters for LDAP integration

Post by ls86 »

I am very new to both LDAP as well as testlink and i would really appreciate it if some one could help me out with this.

I am confused about the parameters to set for LDAP authentication.

I am running Ubuntu Hardy Heron
I have installed LDAP under /etc/ldap
I can access my ldap thru phpldapadmin by visiting
http://localhost/phpldapadmin/

Now,I want to use ldap with testlink.My testlink is installed in the directory /var/www

in the file /testlink/config.inc.php i have made the following changes:



/** Login authentication

* possible values: '' or 'MD5' => use password stored on db

* 'LDAP' => use password from LDAP Server

*/

$g_login_method= 'LDAP';



// LDAP authentication are developed by mantis project (www.mantisbt.org)

// Example:

// $g_ldap_bind_dn = 'my_bind_user';

// $g_ldap_bind_passwd = 'my_bind_password';



/*$g_ldap_server= 'localhost';*/
$g_ldap_server= '/etc/ldap';

$g_ldap_port= '389';

$g_ldap_root_dn= 'dc=localhost,dc=localhost';

$g_ldap_organization = '(objectClass=*)'; # e.g. '(organizationname=*Traffic)'

$g_ldap_uid_field= 'sAMAccountName'; # Use 'sAMAccountName' for Active Directory

$g_ldap_bind_dn= 'admin'; // Left empty if you LDAP server allows anonymous binding

$g_ldap_bind_passwd = 'admin'; // Left empty if you LDAP server allows anonymous binding



(My user id and password for ldap is 'admin' and 'admin')

and in /testlink/login.php i added these lines

$login_method = config_get('login_method');
$g_ldap_server = '/etc/ldap';
$g_ldap_port = '389';
$g_ldap_root_dn = 'dc=localhost,dc=localhost';
$g_ldap_organization = '(objectClass=*)'; # e.g. '(organizationname=*Traffic)'
$g_ldap_uid_field = 'sAMAccountName'; # Use 'sAMAccountName' for Active Directory
$g_ldap_bind_dn = 'admin'; // Left empty if you LDAP server allows anonymous binding
$g_ldap_bind_passwd = 'admin'; // Left empty if you LDAP server allows anonymous binding
$ldap_password_mgmt = ('LDAP' == $login_method )? 1 : 0;

$login_disabled=0;

if($ldap_password_mgmt && !extension_loaded("ldap") )

{

$login_disabled=1;

}

when i login with my name and password :admin,admin
an error was shown in index.php and
i was redirected to the login page all over again

to see the error i commented out line 94 in /var/www/testlink/lib/functions/doAuthorize.php

this is the error i am getting:

Warning: ldap_connect() [function.ldap-connect]: Could not create session handle: Bad parameter to an ldap routine in /var/www/testlink/lib/functions/ldap_api.php on line 35

Warning: ldap_set_option(): supplied argument is not a valid ldap link resource in /var/www/testlink/lib/functions/ldap_api.php on line 38

Warning: ldap_set_option(): supplied argument is not a valid ldap link resource in /var/www/testlink/lib/functions/ldap_api.php on line 39

If someone can please help me out i would really appreciate it.
I have gone through all the forum posts but the solution to my problem is still evading me.

thanks
fman
Member of TestLink Community
Posts: 3123
Joined: Tue Nov 15, 2005 7:19 am

Post by fman »

1. as usual you need to install phpMyLDAPAdmin and test if you cna connect to your ldap sever

2. very strange that you can use a directory /etc/ldap instead a server name to point ldap server , iMHO is wrong
ls86
TestLink user
Posts: 2
Joined: Tue Nov 11, 2008 7:11 am

Post by ls86 »

Thanks fman,
you were right,the problem was with my LDAP config.Once i got that sorted out...everything else fell into place
Locked