using openldap for authentication database ( LDAP )

General discussion of Mantis.

Moderators: Developer, Contributor

Post Reply
eightn
Posts: 5
Joined: 09 Aug 2005, 13:07

using openldap for authentication database ( LDAP )

Post by eightn »

First, sorry for my bad english.

I try to using ldap database for store user logins/passwords.
I have worked domain under samba-3.0.14a-r3, openldap-2.2.27-r1 with GOSA manage interface.

mantisbt-1.0.0_rc1

I have add these records to config_inc.php

[code]
$g_ldap_server = 'ldap://ldap.company.ru/';
$g_ldap_port = '389';
$g_ldap_root_dn = 'dc=intra,dc=company,dc=ru';
$g_ldap_organization = ''; # e.g. '(organizationname=*Traffic)'
$g_ldap_uid_field = 'uid'; # Use 'sAMAccountName' for Active
$g_ldap_bind_dn = 'cn=mantis,dc=intra,dc=vedapro,dc=ru';
$g_ldap_bind_passwd = 'my-secret-password';
$g_use_ldap_email = ON; # Should we send to the LDAP email
$g_login_method = LDAP;
[/code]


In ldap these record are exist (login test, password test):
[code]
dn: uid=test,ou=users,dc=intra,dc=company,dc=ru
structuralObjectClass: inetOrgPerson
loginShell: /bin/false
uidNumber: 10007
gidNumber: 513
mail: test@company.ru
uid: test
objectClass: sambaSamAccount
objectClass: gosaMailAccount
objectClass: posixAccount
objectClass: shadowAccount
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
objectClass: gosaAccount

(some fields are skipped)
[/code]

When I try to login into Mantis from web iface with user test and password test, I receive error:
Your account may be disabled or blocked or the username/password you entered is incorrect



log from ldap server:
[code]
slapd[11886]: conn=6291 fd=55 ACCEPT from IP=1.2.3.4:42082 (IP=5.6.7.8:389)
slapd[11972]: conn=6291 op=0 BIND dn="cn=mantis,dc=intra,dc=company,dc=ru" method=128
slapd[11972]: conn=6291 op=0 BIND dn="cn=mantis,dc=intra,dc=company,dc=ru" mech=SIMPLE ssf=0
slapd[11972]: conn=6291 op=0 RESULT tag=97 err=0 text=
slapd[11892]: conn=6291 op=1 SRCH base="dc=intra,dc=company,dc=ru" scope=2 deref=0 filter="(&(uid=administrator))"
slapd[11892]: conn=6291 op=1 SRCH attr=uid dn
slapd[11892]: conn=6291 op=1 SEARCH RESULT tag=101 err=0 nentries=1 text=
slapd[11891]: conn=6291 op=2 BIND anonymous mech=implicit ssf=0
slapd[11891]: conn=6291 op=2 BIND dn="uid=Administrator,ou=Users,dc=intra,dc=company,dc=ru" method=128
slapd[11891]: conn=6291 op=2 RESULT tag=97 err=49 text=
slapd[11971]: conn=6291 op=3 UNBIND
slapd[11971]: conn=6291 fd=55 closed
[/code]


Whats mean 'SRCH base="dc=intra,dc=company,dc=ru" scope=2 deref=0 filter="(&(uid=administrator))"' ?
I try to login with user "test" :(



Also I found this comment
[code]
#############################
# Mantis LDAP Settings
#############################

# look in README.LDAP for details
[/code]
in config_defaults_inc.php file, but can't found readme.ldap file :(
eightn
Posts: 5
Joined: 09 Aug 2005, 13:07

Post by eightn »

Anybody!

SOS !!! :)
vijay.opensource
Posts: 9
Joined: 18 Dec 2006, 05:26

using openldap for authentication database ( LDAP )

Post by vijay.opensource »

Hi,
Sorry but I have seen your query so lately, but I am glad I know the answer, register to mantis with same user-id and sign with the password that you have produced in LDAP for that ID.

This must fix the problem.

Manohar
mlowrie
Posts: 1
Joined: 22 Jan 2007, 05:26

Post by mlowrie »

I found that it fails because the user is not in MySQL database. Even though it exists in LDAP, if the user doesn't exist in the database, it will fail.

To get it to work for me, I have done the following:
Install Mantis 1.0.6

Install a new authentication_api.php file from bug 5595:
http://www.mantisbt.org/bugs/view.php?id=5595

This will automatically generate the entry in MySQL for you.

I also created some changes that brings in the "real name" as well. See bug 7731:
http://www.mantisbt.org/bugs/view.php?id=7731

Ayone else have any other solutions? Has this been fixed in newer versions?

Mike
Post Reply