LDAP with Group Authentication (SOLVED!!!)

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
remensperger
Posts: 1
Joined: Thu Jan 29, 2009 6:10 pm
Location: Los Angeles

LDAP with Group Authentication (SOLVED!!!)

Post by remensperger »

I have been attempting to get group authentication working for the last few hours. Just figured it out, thought I'd lend a hand to those still struggling.

This is assuming you have gotten LDAP to work already.

My setup:

Version 0.8.7c
OS Debian (VMWare)
Apache2
PHP5

Authentication Method: LDAP Authentication
Server: domainserver.domain.com
Port: 389
Version: 3
Encryption: None
Mode: Specific
Distinguished Name: (Doesnt matter)
Require Group Membership: Checked
Group Distingished Name: (DN to your group) ie CN=Cacti,OU=Intranet,DC=lb,DC=domain,DC=com
Group Membership Attribute: member
Group Member Type: Distingished Name
Search Base: ou=users,dc=lb,dc=domain,dc=com
Search Filter: (&(objectclass=user)(objectcategory=user)(sAMAccountName=<username>))
Search Distingished Name: (Valid Username)
Search Password: (Valid Password)


With all this configured correctly I could not get it to work for the life of me. I would keep getting this error message: LDAP Error: Group DN could not be found to compare. As I have some php and ldap authentication knowledge I started looking thought the php files. Inside of ldap.php I found the error. I noticed @ldap_compare was using a variable that I could not find defigned anywhere. Turns out it must have been typed wrong. I modified these two lines:

$ldap_group_response = @ldap_compare($ldap_conn,$ldap_group,$ldap_group_attrib,$ldap_dn);

$ldap_group_response = @ldap_compare($ldap_conn,$ldap_group,$ldap_group_attrib,$username);

to

$ldap_group_response = @ldap_compare($ldap_conn,$ldap_group_dn,$ldap_group_attrib,$ldap_dn);

$ldap_group_response = @ldap_compare($ldap_conn,$ldap_group_dn,$ldap_group_attrib,$username);

From there you should be golden!
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Added this to mantis and assigned to me
http://bugs.cacti.net/view.php?id=1385
Reinhard
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Solved in SVN#4900
Reinhard
monkeypaul
Posts: 1
Joined: Thu Feb 19, 2009 3:39 pm

LDAP with Group Authentication (SOLVED!!!)

Post by monkeypaul »

New bug in the svn:

function cacti_ldap_search_dn($username,$ldap_dn
$username is missing the "" causing all auth to fail using specified username.

P
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please open a new bug report as given by http://www.cacti.net/bugs.php. If possible, attach a patch
Reinhard
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Um, you shouldn't have to do that.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
sabir_mustafa
Posts: 5
Joined: Fri Jun 11, 2010 8:40 am
Location: Rawalpindi

OpenLdap Authentication Problem

Post by sabir_mustafa »

Hi:
I am using RedHat Directory Server 8 and CactiEZ 0.8.7c. My following configuration let the user logon through LDAP.

Authentication Method = LDAP Authentication
Guest User = No user
User Template = No user
Server = IP Address of LDAP server
Port = 389
Protocol Version = 3
Refeeral = Disables
Mode = No Searching
Distinguished Name (DN) = uid=<username>, ou=ouname, dc=dcname, dc=dcname, dc=dcname
Search Base = "dc=dcname,dc=dcname,dc=dcname" (with quotes)

Now I had made a group in LDAP Server and want only the group users to login to cacti. But it does not work. I also applied the error patch as mentioned above but still the result is null.

Please guide me on how to do this.
cmarko
Posts: 1
Joined: Mon Dec 20, 2010 7:37 pm

Re: LDAP with Group Authentication (SOLVED!!!)

Post by cmarko »

I ran into same issue and submitted patch. http://bugs.cacti.net/view.php?id=1919 solves this.

Cheers,
Chris
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests