phpactive-directoryldapmantis

Connect a system with Active Directory (AD)


I followed all the instructions to connect Mantis to AD, until I created a specific user in AD and even then I can not connect the two for AD authentication.

error:

'ldap_search(): Search: Bad search filter' in 'C:\inetpub\wwwroot\mantisbt-2.0.0\core\ldap_api.php' line 335

Original instructions from the developer site

My Settings:

$g_login_method = LDAP;
$g_ldap_server = 'ldap://IP_Server:389';  
$g_ldap_root_dn = 'dc=company,dc=technology'; 
$g_ldap_organization = 'company technology';
$g_ldap_protocol_version = 3; 
$g_ldap_uid_field = 'sAMAccountName';
$g_ldap_realname_field = 'cn';
$g_use_ldap_realname = ON; 
$g_use_ldap_email = ON;
$g_ldap_bind_dn =  'mantis'; //User AD
$g_ldap_bind_passwd = '*******'; //Password AD
$g_ldap_follow_referrals = ON;
$g_log_level = LOG_LDAP;
$g_log_destination = 'file:C:\mantisbt.log';

LOG

> ldap_api.php:326 ldap_authenticate_by_username() Binding to LDAP
> server ldap_api.php:63 ldap_connect_bind() Attempting connection to
> LDAP server/URI 'ldap://IP_Server:389'. ldap_api.php:66
> ldap_connect_bind() Connection accepted by LDAP server ldap_api.php:79
> ldap_connect_bind() Setting LDAP protocol version to 3
> ldap_api.php:101 ldap_connect_bind() Attempting bind to ldap server
> with username and password ldap_api.php:114 ldap_connect_bind() Bind
> to ldap server successful ldap_api.php:334
> ldap_authenticate_by_username() Searching for (&company technology(sAMAccountName=paulo.roberto))

Solution

  • You must enter a valid search filter for $g_ldap_organization, if you want to restrict the entries available for authentication. Most likely you want to leave this variable empty.