Ldap Authentication Failed. Application Error #1400

Get help from other users here.

Moderators: Contributor, Developer

Post Reply
Darkmoon
Posts: 4
Joined: May 24, 2016 1:59 am

Ldap Authentication Failed. Application Error #1400

Post by Darkmoon » May 24, 2016 2:20 am

Hi.
I wanted to enable the Ldap Authentication for an on-premise Mantis Server running Version 1.2.19 to authenticate to Active Directory.
Have configured config_inc.php:
$g_login_method = LDAP;
$g_ldap_server = 'ldap://xxxxx.xxxxx.com:389';
$g_ldap_root_dn = 'OU=XXXX,DC=xxxx,DC=com';
$g_ldap_protocol_version = 3;
$g_ldap_follow_referrals = OFF;
$g_ldap_bind_dn = 'CN=Username,OU=Service Accounts,OU=Location1,OU=Location2,OU=XXXXX,DC=XXXXXX,DC=com';
$g_ldap_bind_paswd = 'password';
$g_ldap_uid_field = 'sAMAccountName';
$g_use_ldap_email = ON;

When pressing the Login button at the Mantis Site it shows this error:
APPLICATION ERROR #1400
LDAP Authentication Failed.

Full path: /var/www/core/ldap_api.php
Line: 363

p_username administrator string
p_password ********** string
c_username administrator string
t_ldap_organization string
t_ldap_root_dn OU=MCHP-MAIN,DC=mchp-main,DC=com string
t_ldap_uid_field sAMAccountName string
t_search_filter (&(sAMAccountName=administrator)) string
t_ds Resource id #14 unknown type
t_sr boolean

/var/www/core/ldap_api.php 363 - - trigger_error ( <string>'1400', <integer>256 )
/var/www/core/ldap_api.php 321 - - ldap_authenticate_by_username ( <string>'administrator', <string>'root' )
/var/www/core/authentication_api.php 363 - - ldap_authenticate ( <string>'1', <string>'root' )
/var/www/login_page.php 199 - - auth_does_password_match ( <string>'1', <string>'root' )

What is the p_username and p_password field, this is not reflecting the bind user i have configured?
And what is the c_username field? Why is there "Administrator" filled in, i do not want to authenticate with Administrator User to Ldap.

If somebody have an idea how to configure the ldap login to AD successfully let me know :-)

Darkmoon
Posts: 4
Joined: May 24, 2016 1:59 am

Re: Ldap Authentication Failed. Application Error #1400

Post by Darkmoon » May 24, 2016 2:53 am

in the meantime i have enabled ldap logging:
$g_log_level = LOG_LDAP;

then i found this:

[Tue May 24 09:46:00.466629 2016] [:error] [pid 9902] [client xxx.xxx.xxx.xx:1044] 24-05-2016 09:46 CEST ldap Bind to ldap server successful\n, referer: http://xxx.xxx.xxx.xx/main_page.php
[Tue May 24 09:46:00.466663 2016] [:error] [pid 9902] [client xxx.xxx.xxx.xx:1044] 24-05-2016 09:46 CEST ldap Searching for (&(sAMAccountName=administrator))\n, referer: http://xxx.xxx.xxx.xx/main_page.php
[Tue May 24 09:46:00.466945 2016] [:error] [pid 9902] [client xxx.xxx.xxx.xx:1044] 24-05-2016 09:46 CEST ldap ERROR #1: Operations error\n, referer: http://xxx.xxx.xxx.xx/main_page.php
[Tue May 24 09:46:00.467026 2016] [:error] [pid 9902] [client xxx.xxx.xxx.xx:1044] 24-05-2016 09:46 CEST ldap ldap search failed\n, referer: http://xxx.xxx.xxx.xx/main_page.php

So it seems, ldap bind is successful but it tries to search a user "administrator". Where can i define this?
It should not use Administrator, the Root DN has no Admins inside, just users.

atrol
Site Admin
Posts: 7506
Joined: Mar 26, 2008 4:37 pm
Location: Germany

Re: Ldap Authentication Failed. Application Error #1400

Post by atrol » May 24, 2016 4:20 am

Darkmoon wrote:tries to search a user "administrator". Where can i define this?
Isn't this the user name you entered on Mantis logon page?
Please use Search before posting and read the Manual

Darkmoon
Posts: 4
Joined: May 24, 2016 1:59 am

Re: Ldap Authentication Failed. Application Error #1400

Post by Darkmoon » May 24, 2016 4:24 am

I cannot enter a username, when i click on login the error comes up. i have no chance to enter a username, except when i disable the ldap login completely.

please see my last reply, the ldap bind is working but it tries to use administrator for some reason.

atrol
Site Admin
Posts: 7506
Joined: Mar 26, 2008 4:37 pm
Location: Germany

Re: Ldap Authentication Failed. Application Error #1400

Post by atrol » May 24, 2016 4:36 am

Mantis does not connect to LDAP before entering user name and password and clicking the login button.
At least it does not with standard settings.

You might have changed setting $g_display_errors in a wrong way so that certain kind of errors do no longer stop the system.
Please use Search before posting and read the Manual

Darkmoon
Posts: 4
Joined: May 24, 2016 1:59 am

Re: Ldap Authentication Failed. Application Error #1400

Post by Darkmoon » May 24, 2016 6:30 am

Thanks a lot atrol.

You were completely right. $g_display_errors were set wrong, now i got the logon screen.

kieling
Posts: 2
Joined: Jun 19, 2017 1:23 pm

Re: Ldap Authentication Failed. Application Error #1400

Post by kieling » Jun 19, 2017 1:28 pm

I have the same issue. However, $g_display_errors isn't set.
I cannot enter a username, when i click on login the error comes up. I have no chance to enter a username. Any idea?

Thanks!

Post Reply