Ldap APPLICATION ERROR #1401

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
Celso
Posts: 13
Joined: 25 Apr 2023, 14:42

Ldap APPLICATION ERROR #1401

Post by Celso »

Hello i have a problem when i try to connect to my AD with ldap it gives me the 1401 error.

I have seen a lot of posts with this error but none of the solutions they gave me works.

I checked that the firewall is not interfering so i know that the problem is in the config_inc.php

My configuration is like this:

$g_login_method = LDAP;
$g_ldap_server = 'ldap://IP:389';
$g_ldap_root_dn = 'OU=Name,DC=example,DC=com';
$g_ldap_uid_field = 'sAMAccountName';
$g_ldap_organization = '(objectClass=*)';
$g_ldap_realname_field = 'DisplayName';
$g_ldap_bind_dn = 'CN=UserName,OU=Name,OU=name,OU=name,DC=example,DC=com';
$g_ldap_bind_passwd = 'xxxx';
$g_log_level = LOG_LDAP;
$g_log_destination = '/var/log/mantisbt.log';
$g_use_ldap_email = ON;
$g_use_ldap_realname = ON;
$g_ldap_follow_referrals = OFF;
$g_ldap_use_starttls = OFF;
$g_show_realname = ON;
$g_ldap_protocol_version = 3;


PD:
OS: Ububtu 22.04
PHP 8.1
Mantis 2.22.1

Thanks
Whatelse
Posts: 1
Joined: 26 Apr 2023, 18:55

Re: Ldap APPLICATION ERROR #1401

Post by Whatelse »

If you have enabled log_ldap, could you let me know the file content with logs? with this info and cofee break will probably we found the problem.
Celso
Posts: 13
Joined: 25 Apr 2023, 14:42

Re: Ldap APPLICATION ERROR #1401

Post by Celso »

the log info:
LDAP ldap_api.php:327 ldap_authenticate_by_username() Binding to LDAP server\n
LDAP ldap_api.php:63 ldap_connect_bind() Attempting connection to LDAP server/URI 'ldap://example.com:389'.\n
LDAP ldap_api.php:117 ldap_connect_bind() Connection to ldap server failed\n

It shows me only this three lines over and over.
cas
Posts: 1581
Joined: 11 Mar 2006, 16:08
Contact:

Re: Ldap APPLICATION ERROR #1401

Post by cas »

I assume you replaced example.com with your domain? Just to be sure :mrgreen:
Celso
Posts: 13
Joined: 25 Apr 2023, 14:42

Re: Ldap APPLICATION ERROR #1401

Post by Celso »

yes
Celso
Posts: 13
Joined: 25 Apr 2023, 14:42

Re: Ldap APPLICATION ERROR #1401

Post by Celso »

I tried using ldapsearch and it works and shows me the information of the user i asked (connects with the AD well)

But when i try to connect via from web browser it gives me the #1401 error Connection to LDAP server failed.
atrol
Site Admin
Posts: 8353
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Ldap APPLICATION ERROR #1401

Post by atrol »

Please use Search before posting and read the Manual
Celso
Posts: 13
Joined: 25 Apr 2023, 14:42

Re: Ldap APPLICATION ERROR #1401

Post by Celso »

Thanks i downgraded my php to 8.0 and updated my mantis to 2.25.7 and it works
Celso
Posts: 13
Joined: 25 Apr 2023, 14:42

1406 Error

Post by Celso »

Ok now i have another error #1406 that says 'Cannot initiate StartTLS on LDAP server.'
My config_inc.php is like this:
$g_login_method = LDAP;
$g_ldap_protocol_version = 3;
$g_ldap_server = 'ldap://example.com:389';
$g_ldap_root_dn = 'ou=name,dc=example,dc=com';
$g_ldap_organization = '';
$g_ldap_uid_field = 'sAMAccountName';
$g_ldap_realname_field = 'cn';
$g_use_ldap_realname = 'ON';
$g_ldap_follow_referrals = 'OFF';
$g_use_ldap_email = 'ON';
$g_ldap_bind_dn = 'CN=name,OU=name,OU=HQ,OU=name,DC=example,DC=com';
$g_ldap_bind_passwd = 'xxxx';
$g_ldap_use_starttls = 'OFF';
$g_log_level = LOG_LDAP;
#$g_log_destination = file:/var/log/mantisldap.log;

I tried to change it to ldaps and 636 but it doesnt matter it keeps giving me th 1406 error
atrol
Site Admin
Posts: 8353
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: 1406 Error

Post by atrol »

As opposed to your old configuration, your new configuration uses 'ON' and 'OFF'.
It must be ON and OFF.
Please use Search before posting and read the Manual
Celso
Posts: 13
Joined: 25 Apr 2023, 14:42

Re: Ldap APPLICATION ERROR #1401

Post by Celso »

Thanks now it works
atrol
Site Admin
Posts: 8353
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Ldap APPLICATION ERROR #1401

Post by atrol »

Good to hear, thanks for the feedbacl.
Please use Search before posting and read the Manual
Post Reply