From: Michaud Tim-A. <AT...@mo...> - 2001-02-15 19:58:07
|
Jim- OH thank you so very much! I am much more enlightened to the omnipowerful ways of LDAP now that i can bind. Cheers! Timothy Michaud -----Original Message----- From: Jim Harle To: Michaud Tim-ATM095 Cc: 'per...@li...' Sent: 2/15/01 1:24 PM Subject: Re: newbie looking for binding help Tim, you must bind to a DN (and password), not cn or uid. Typically, scripts will do an anonymous bind, do a search with afilter something like (uid=$uid), get the dn back via ->dn, then use that with the password for the authenticated bind. --Jim Harle Michaud Tim-ATM095 wrote: > Hello, I've been researching this for a while, but am unable to perform a bind. I'm sorry to post what is probably a simple question, but after days of looking at slim documentation i'm in need of help. If anyone has links to good beginners perl - ldap documentation, i'd be happy to hear them. > > When i connect to the LDAP server, bind annonomously, and do a search i am able to retrieve data fine. But when i tried to bind and authenticate, i began getting an error 32 message. Can you only bind using the cn and password? or can you use other attributes, like what i used here- 'uid' ? > > Here is my code- > > #!/usr/local/bin/perl > use strict; > use Net::LDAP; > my $host = 'ids.mot.com'; #name of the LDAP host > my $uid = shift; > my $pw = shift; > my $ldap = new Net::LDAP($host); > #authenticate to the LDAP server as the directory super-user > my $mesg = $ldap->bind('uid=$uid', password=> $pw); > die ("failed to bind with ",$mesg->code(),"\n") if $mesg->code(); > > When i enter what i believe to be correct info, i get an error 32, if i just leave the l/p info blank, i get an error 48. Is there documentation on these error codes somewhere? > > Sorry and Thanks in advance, > Timothy Michaud |