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:

$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' );
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?

In reply to Perl and ldap by alwaysuseperl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.