alwaysuseperl has asked for the wisdom of the Perl Monks concerning the following question:
Hey guys. Im trying to write a script that will pull data from a mysql server, the login for the mysql server is static, it wont change. But the script pulls certain data out depending on your username you login to the script with. I want the script to authenticate with ldap. so you execute it.. type in your ldap username and password.. and if it accepts it, then it will continue. It doesnt actually need to pull data from ldap.
right now I have this..
use Net::LDAP; use Data::Dumper; $ldap = Net::LDAP->new ( "directory-01.xxxxxx.dom" ) or die "$@"; $mesg = $ldap->bind ( "jhyland", password => "xxxxxx", version => 3 ); # use for changes/edit +s print Dumper($mesg);
Which returns this:
Now.. if I change the username and password to a non existing username/password.. it returns the same thing, any idea what I can do?$VAR1 = bless( { 'parent' => bless( { 'net_ldap_version' => 3, 'net_ldap_scheme' => 'ldap', 'net_ldap_debug' => 0, 'net_ldap_socket' => bless( \*Sy +mbol::GEN0, 'IO::Socket::INET' ), 'net_ldap_host' => 'directory-01 +.jawa.dom', 'net_ldap_uri' => 'directory-01. +jawa.dom', 'net_ldap_resp' => {}, 'net_ldap_mesg' => {}, 'net_ldap_async' => 0, 'net_ldap_port' => 389, 'net_ldap_refcnt' => 1 }, 'Net::LDAP' ), 'errorMessage' => '', 'ctrl_hash' => undef, 'resultCode' => 32, 'callback' => undef, 'mesgid' => 1, 'matchedDN' => '', 'controls' => undef, 'raw' => undef }, 'Net::LDAP::Bind' );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl and ldap
by affc (Scribe) on Oct 02, 2010 at 17:36 UTC | |
|
Re: Perl and ldap
by ig (Vicar) on Oct 02, 2010 at 18:22 UTC |