[squid-users] Perl Group Ldap Auth

From: Riccardo Baldanzi <riccardo.baldanzi@dont-contact.us>
Date: Wed, 20 Feb 2002 15:54:01 +0100

Hi all,

me and a colleague have written a perl script for group ldap auth (we use
with M$ Active Directory).

Hope this helps.

King Regdards,

Riccardo Baldanzi
Efrem Locarno

P.S. i'm going to integrate LDAP query directly with perl functions (i.e.
with Net::LDAP)

That's the code:

#Riccardo Baldanzi riccardo.baldanzi@tin.it
#Locarno Efrem locarno@imunant.com
#group ldap authentication

while (<STDIN>)

#flush STDOUT

#STDIN input
@params = split / /;
$username = @params[0];
$password = @params[1];

if ($username eq "")
        print "ERR\n";
        @array=qx(ldapsearch -LLL -D CN=$username,CN=Users,DC=yourcompany,DC=com
-w $password -b CN=InternetGroup,CN=Builtin,DC=yourcompany,DC=com -x -v -s
sub -h member=CN=$username,CN=Users,DC=yourcompany,DC=com


        foreach $linearr (@array)
        {if ($linearr=~m/distinguishedName/) {$isgood=1;}}

        if ($isgood==0) {print "ERR\n";} else {print "OK\n";}
Received on Wed Feb 20 2002 - 07:53:49 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 17:06:28 MST