unable to login after LDAP setup

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
wing
Posts: 1
Joined: 05 Jun 2021, 06:45

unable to login after LDAP setup

Post by wing »

Hi all,

I have enable LDAP Authentication with following config
$g_login_method = LDAP;
$g_ldap_server = 'ldap://AD IP:389/';
#$g_ldap_port = 3268;
$g_ldap_root_dn = 'cn=Users,dc=abc,dc=com';
$g_ldap_bind_dn = 'cn=ldapuser,cn=Users,dc=abc,dc=com';
$g_ldap_bind_passwd = 'P@ssword';
$g_use_ldap_email = OFF;
$g_ldap_uid_field = 'sAMAccountName';
$g_ldap_realname_field = 'cn';
$g_use_ldap_realname = ON;
$g_ldap_organization = '';
$g_ldap_protocol_version = 3;
$g_send_reset_password = OFF;
$g_log_level = LOG_LDAP;
I have tried an AD user and default Mantis Administrator. Both cannot login
Showing...
Your account may be disabled or blocked or the username/password you entered is incorrect.
After I disable those LDAP setting, "Administrator" is able to login again.
For the LDAP config, I have tried ldapsearch to make sure those are corrent.
MantisBT version: 2.6.0

Does anyone know the possible cause
Thank you.
mushu
Posts: 349
Joined: 04 Jan 2017, 17:41

Re: unable to login after LDAP setup

Post by mushu »

Mine works, here is an example. Make sure you add the OU as well. Also ensure you enabled the adLogin LDAP plugin. You will have to update that plugin code on this line to ensure a higher base config:

Code: Select all

$this->requires    = array('MantisCore'       => '2.0.0',);
From my config file:

Code: Select all

/* $g_log_level              = LOG_LDAP; */

$g_login_method           = LDAP; /* a constant so not quoted */
$g_ldap_server            = 'ldap://domainController:389';
$g_ldap_root_dn           = 'OU=org unit name,DC=pre,DC=conteso,DC=com';
$g_ldap_organization      = ''; /* empty */
$g_ldap_uid_field         = 'sAMAccountName';
$g_ldap_realname_field    = 'name';
$g_ldap_bind_dn           = 'pre\account';
$g_ldap_bind_passwd       = 'password';
$g_use_ldap_email         = ON;
$g_use_ldap_realname      = ON;
$g_ldap_protocol_version  = 3;
$g_ldap_follow_referrals  = OFF;
Post Reply