Configuring LDAP

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
drm
Posts: 3
Joined: 30 Nov 2005, 17:53

Configuring LDAP

Post by drm »

G'day,

After much research, I found a posting that stated to add the following lines to ldap_api.php - function ldap_connect_bind( $p_binddn = '', $p_password = '' ) (which helped)

ldap_set_option($t_ds, LDAP_OPT_PROTOCOL_VERSION, 3))
ldap_set_option($t_ds, LDAP_OPT_REFERRALS, 0);

However, as 1 posting stated

function ldap_authenticate( $p_user_id, $p_password )

seems to always use administrator in it's search for the id to authenticate, not the sAMAccountName. I get pass authentication when I hard code a valid sAMAccountName. Is this a bug?

Also, once I hardcoded the above, Mantis only logs me in if I supply a valid or invalid password but not an empty password. Is this a bug?

Can someone help me out? Thanks


Versions:
Windows 2K
Mantis 1.0.0rc2
MySQL Server 4.1.14
Apache v2.0.55
PHP 4.4.0
AD on Y2K
Yuhu Xia

Post by Yuhu Xia »

Could anybody give an example how to set LDAP parameters for using Active Directory?

$g_ldap_server = '???';
$g_ldap_port = '???';
$g_ldap_root_dn = '???';
$g_ldap_organization = '???';
$g_ldap_uid_field = '???';
$g_ldap_bind_dn = '???';
$g_ldap_bind_passwd = '???';
$g_use_ldap_email = OFF;

Thanks! :lol:
shark
Posts: 43
Joined: 12 Jul 2005, 22:23

Post by shark »

Yuhu Xia wrote:Could anybody give an example how to set LDAP parameters for using Active Directory?

$g_ldap_server = '???';
$g_ldap_port = '???';
$g_ldap_root_dn = '???';
$g_ldap_organization = '???';
$g_ldap_uid_field = '???';
$g_ldap_bind_dn = '???';
$g_ldap_bind_passwd = '???';
$g_use_ldap_email = OFF;

Thanks! :lol:
$g_ldap_server = "ldap://aaa.bbb.ccc.ddd/";
$g_ldap_port = "389";
$g_ldap_root_dn = "OU=eee,OU=fff,OU=ggg,DC=hhh,DC=iii";
$g_ldap_organization = "";
$g_ldap_uid_field = "sAMAccountName";
$g_ldap_bind_dn = "CN=bindname,OU=jjj,DC=hhh,DC=iii";
$g_ldap_bind_passwd = "password";
$g_use_ldap_email = ON;

Obviously I changed somethings :D , but this is what is working for me currently.

Mantis Note: The user account has to be in Mantis (with a blank password) before it can be used against AD.

I found the hardest part was configuring php, actually.

1) 2 DLL's need to be in the windows\system32 dir
2) php.ini needs to have the this line uncommented: "extension=php_ldap.dll"
3) I had to move php.ini to c:\winnt

and then everything worked.

edit:
This is running on Windows 2000 against Windows 2003 Domain Controllers.
Post Reply