How to login thanks to OpenLDAP

Ask community to help.

Moderators: Amaradana, TurboPT, TL Developers

Post Reply
yoggy
TestLink user
Posts: 5
Joined: Fri Jun 22, 2007 4:21 pm

How to login thanks to OpenLDAP

Post by yoggy »

Hello,

I already installed Testlink and it's in production.
The DB is MySQL but I would like to know how can I do to use an OpenLDAP authentification?

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

Post by fman »

Our code is based on mantis -> give a look to mantis manual (because we have no section about this).
yoggy
TestLink user
Posts: 5
Joined: Fri Jun 22, 2007 4:21 pm

Post by yoggy »

Thank you for your answer.

May I come back to you if I have some problems with this?
fman
Member of TestLink Community
Posts: 3123
Joined: Tue Nov 15, 2005 7:19 am

Post by fman »

Yes, you can.
I've done the code porting/copy from mantis.
I've tested it long time ago on my windows XP, with an ldap version I've found on internet

regards
yoggy
TestLink user
Posts: 5
Joined: Fri Jun 22, 2007 4:21 pm

Post by yoggy »

Hello,

I found this:
http://www.mantisbt.org/manual/manual.c ... s.ldap.php
http://www.mantisbt.org/forums/viewtopic.php?t=618

But, I don't find core/user_API.php; so I added this in config.inc.php:
$g_ldap_server = 'ldap://localhost';
$g_ldap_port = '389';
$g_ldap_root_dn = 'ou=People,dc=company,dc=com';
$g_ldap_uid_field = 'uid';
$g_ldap_bind_dn = 'cn=Manager,dc=company,dc=com';
$g_ldap_bind_passwd = 'ManagerPassword';
$g_use_ldap_email = OFF;
$g_login_method = LDAP;

I was connected to Testlink as admin and I added a user (a login existing in OpenLDAP) but without password.

I tried to connect to Testlink with this user/password (password from openldap) but it doesn't work.

Can you tell me what I did wrong?

I would like to specifiy I'm already using others softwares which are using OpenLDAP for authentification and they're working (so it's not a problem with OpenLDAP configuration)

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

Post by fman »

I will try to do some tests on my laptop, and give you some answers asap.
fman
Member of TestLink Community
Posts: 3123
Joined: Tue Nov 15, 2005 7:19 am

Post by fman »

I have tested on my XP with this config:

$g_login_method = 'LDAP';
$g_ldap_server = 'localhost';
$g_ldap_port = '389';
$g_ldap_root_dn = 'dc=mycompany,dc=com';
$g_ldap_organization = ''; # e.g. '(organizationname=*Traffic)'
$g_ldap_uid_field = 'uid'; # Use 'sAMAccountName' for Active Directory
$g_ldap_bind_dn = ''; // Left empty if you LDAP server allows anonymous binding
$g_ldap_bind_passwd = ''; // Left empty if you LDAP server allows anonymous binding

I have used Anonymous binding to LDAP, and worked OK.
Have not tried with user and password for binding.

I suggest to get LAst CVS code, because I'have made some fixes
regarding LDAP yesterday.

I'm using ILEX slapd 2.0.27

Regards
yoggy
TestLink user
Posts: 5
Joined: Fri Jun 22, 2007 4:21 pm

Post by yoggy »

"I suggest to get LAst CVS code, because I'have made some fixes
regarding LDAP yesterday. " => In 1.6 or in 1.7 ?

I have the same configuration in my config.inc.php (except for $g_ldap_root_dn; in my configuration $g_ldap_root_dn = 'ou=people,dc=mycompany,dc=com' because 'uid' are under this)

But after this, do you need to create a user in Testlink? (I suppose yes)
If yes, do you have to put a password (i suppose no) for this user or can you leave blank?

I'm using OpenLDAP 2.3.35 and TestLink 1.6.2
Should it be ok ? Is there a problem with this version of Testlink for authentification with LDAP ?

Thank you for your answers.
fman
Member of TestLink Community
Posts: 3123
Joined: Tue Nov 15, 2005 7:19 am

Post by fman »

LDAP has been implemented on 1.7, and I have tested it on this version.
Sorry but I'dont remember if we have done some development for LDAP on 1.6.2.
Anyway if you now a little bit of PHP, you can copy the code from 1.7.

The steps you have done, are the same I did.

please let me know
yoggy
TestLink user
Posts: 5
Joined: Fri Jun 22, 2007 4:21 pm

Post by yoggy »

Apparently there isn't OpenLDAP authentification in testlink 1.6.2 and we can't use testlink 1.7
I'm not a PHP expert so it seems a bit complicated, for me, to put the code from 1.7 in 1.6.2, but I will try it.

Thank you for your help.
Post Reply