Below is my configuration:
Code: Select all
$tlCfg->authentication['method'] = 'LDAP';
$tlCfg->authentication['ldap'] = array();
$tlCfg->authentication['ldap'][1]['ldap_server'] = 'dc.example.com';
$tlCfg->authentication['ldap'][1]['ldap_port'] = '389';
$tlCfg->authentication['ldap'][1]['ldap_version'] = '3'; // could be '2' in some cases
$tlCfg->authentication['ldap'][1]['ldap_root_dn'] = 'OU=Domain Users,OU=test,DC=example,DC=com';
$tlCfg->authentication['ldap'][1]['ldap_bind_dn'] = 'CN=svcTEST, OU=OrgUnit, DC=example, DC=com'; // Left empty for anonymous LDAP binding
$tlCfg->authentication['ldap'][1]['ldap_bind_passwd'] = 'xxxxxxxxxxxxxx'; // Left empty for anonymous LDAP binding
$tlCfg->authentication['ldap'][1]['ldap_tls'] = false; // true -> use tls
// Following configuration parameters are used to build
// ldap filter and ldap attributes used by ldap_search()
//
// filter => "(&$t_ldap_organization($t_ldap_uid_field=$t_username))";
// attributess => array( $t_ldap_uid_field, 'dn' );
//
// This can be used to manage situation like explained on post on forum:
// ActiveDirectory + users in AD group
//
// $tlCfg->authentication['ldap'][1]['ldap_organization'] = ''; // e.g. '(organizationname=*Traffic)'
$tlCfg->authentication['ldap'][1]['ldap_uid_field'] = 'sAMAccountName'; // Use 'sAMAccountName' for Active Directory
// Configure following fields in custom_config.inc.php according your configuration
/*$tlCfg->authentication['ldap'][1]['ldap_email_field'] = 'mail';
$tlCfg->authentication['ldap'][1]['ldap_firstname_field'] = 'givenname';
$tlCfg->authentication['ldap'][1]['ldap_surname_field'] = 'sn';
*/
// Follows Mantisbt idea.
// True if user does not exist on DB, but can be get from LDAP,
// the user will be created AUTOMATICALLY with default user role.
// Create user with following data from LDAP
// mail
// name
// surname
$tlCfg->authentication['ldap_automatic_user_creation'] = false;
Code: Select all
ldapsearch -x -LLL -p 389 -h dc1.example.com -D svcTest -w xxxxxxxxxxxxx -b "OU=Domain Users,OU=test,DC=example,DC=com"
Code: Select all
dn: CN=Gil Tea,OU=Retired,OU=Robotics,OU=Domain Users,OU=TEST,
DC=example,DC=com
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: user
cn: Gil Tea
sn: Tea
title: Electrical Engineer
description: Robotics
facsimileTelephoneNumber: +9999999999
givenName: Gil