Esteemed Monks

I am trying to learn Net::LDAP

I wrote a little ditty which worked, then stopped working.

I tracked the problem down to credentials.

I have been following the examples and use the form:

$ldap = Net::LDAP->new( 'ldap.umich.edu' ); # bind to a directory with dn and password $ldap->bind( 'cn=root, o=University of Michigan, c=us', password => 'secret' ) or die "Unable to bind $!\n";
The problem seems to be that if an authenticated bind fails, then an anonymous bind is allowed, so the 'bind' is successful (just not as successful as I hoped).

I have found a 'whoami' extension, in Net::LDAP::Extension::WhoAmI, but the directory I am binding to doesn't seem to support extensions.

So how do I check to see if I am bound as an anonymous or authenticated user?

TIA

Dave R

Nothing succeeds like a budgie with no teeth.

In reply to How do you check a 'bind' in LDAP? by LittleGreyCat

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.