Re: [squid-users] Authentication Modules

From: Mike Diggins <diggins@dont-contact.us>
Date: Wed, 27 Jun 2001 12:54:55 -0400 (EDT)

On Sat, 23 Jun 2001, Henrik Nordstrom wrote:

> Mike Diggins wrote:
>
> > Thanks. Excuse my ignorance but would that be as straight forward as using
> > another script (such as a perl script) to accept the username/password
> > from Squid, test the result against each authentication module and return
> > the the result (OK or ERR) to Squid? Is that what a "wrapper" would do?
>
> Exacly.
>
> If you search the squid-users archives you will find a couple such Perl
> scripts for chaining more than one Baisc HTTP proxy auth helper.

Henrik,

I managed to find a posting where you provided someone else with this perl
wrapper. I substituted the authentication modules as shown below. It works
fine from the command line but not from Squid (2.4Stable1 on Solaris 8).

I called it mac_auth and call that from the Squid.conf file. Cache.log
doesn't show any problems. 5 child processes are started (3 authenticators
each). When I enter a correct username and password at the browser prompt
it doesn't return anything, not even an incorrect password message.
Access.log says TCP_DENIED:NONE. Any idea what I might have missed? Is the
IPC::Open2 a standard Perl module?

#!/usr/bin/perl
use IPC::Open2;
open2(*read1,*write1,"/usr/local/squid/bin/smb_auth -W galaxy -U
130.113.42.205");
open2(*read2,*write2,"/usr/local/squid/bin/ncsa_auth
/usr/local/squid/bin/.htpasswd");
while(<>) {
  print write1 $_; $ans = <read1>;
  if ($ans =~ /^OK/) { print $ans; next; }
  print write2 $_; $ans = <read2>;
  if ($ans =~ /^OK/) { print $ans; next; }
  print $ans;
}
Received on Wed Jun 27 2001 - 10:55:44 MDT

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