bionicle32 has asked for the wisdom of the Perl Monks concerning the following question:
What I am wondering is if my bind is bad code? This is the error sent back to the browser.## Connect and bind to the server. $ldap = Net::LDAP->new("servername.com",port => 389,version => 3 ) or +die $!; my $result = $ldap->bind("id=$uid, o=intra, ou=people, dc=xxxx, dc=xxx +", password => $pswd); if ($result->code != LDAP_SUCCESS) { die $result->error(); # Authentication failed }
Which is the if statement for LDAP_SUCCESS. If indeed this is incorrect syntax why and why would I use dn => to start my bind instead of the way I did it above? When I use double qoutes around uid like this $ldap->bind("uid=$uid"," o=intra, ou=people, dc=xxxx, dc=xxx", password => $pswd); my script works. Is this because I am doing an anonymous bind? All I want to do in short is validate that the user logging into my application is who they say they are. If I have not supplied enough information above please say so and I will explain further so you could help me. I appreciate all of you guys help in the past because your suggestions have helped me in becoming a more knowledgable programmer. -Bionicle32Software error: No such object at login2.cgi line 46.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: LDAP Bind Confusion
by tachyon (Chancellor) on Dec 14, 2003 at 21:14 UTC | |
by bionicle32 (Novice) on Dec 15, 2003 at 18:40 UTC | |
by simonm (Vicar) on Dec 15, 2003 at 19:25 UTC |