Hi monks,

I'm writing a web frontend to manage our company's OpenLDAP server. I'm using Perl, Apache2 with mod_auth_kerb, OpenLDAP, Cyrus SASL. I'm using Authen::SASL for authentication, and the following works fine when run from command line:

1 #!perl 2 use strict; 3 use warnings; 4 use Net::LDAP; 5 use Authen::SASL; 6 7 my $l = Net::LDAP->new( 'ldap.example.com', onerror=>'die', ); 8 my $sasl = Authen::SASL->new(mechanism=>'GSSAPI'); 9 $l->bind( sasl=>$sasl ); 10 11 print "OK\n";

The problem is, when a Kerberos-authenticated user tries to connect to OpenLDAP server using browser (and my unfortunate CGI script), his credentials are not used, and I'm running out of wits wondering how to fix it. By itself, as long as I do not need to forward users credentials, authentication works fine with Apache, too. Ironically, it all works from outside the realm, because then mod_auth_kerb asks for user name and password, authenticates, caches the tickets, and it all works.


In reply to How to authenticate to OpenLDAP using web interface? by BadBishop

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.