External Authorization in Apache--runs too many times

External Authorization in Apache--runs too many times

Post by l.. » Fri, 12 Dec 1997 04:00:00



I'm running Apache/1.2b7 on a Linux box.

I downloaded a module for external authorization (from
ftp://ftp.apache.org/apache/dist/contrib/modules/mod_auth_external.c)
which runs gives an external program a username and password and
waits for an exit value.

When the username/password is *invalid*, everything works fine.

The problem is when the username/password is *valid*. It seems this
module runs my verification program 3-4 times. This is a problem because
my program has a side effect of sending mail so I get the same mail sent
3-4 times for one successful access.

Any ideas how to fix this?

If it matters, I'm trying to do basic user authorization and not group.
In my httpd.conf file, I added:
  AddExternalAuth testing /bin/verifier
and in my .htaccess file for the directory I'm controlling, I put:
  AuthName Testing-Area
  AuthExternal testing
  AuthType Basic
  require valid-user

So, am I even using this module correctly? If so, how can I keep
it from running the external verifier over and over for just one access?

Any help is appreciated!

P.S. My first attempt at a solution was to set a global variable in the
mod_auth_external.c file called "externalProgramValue," initialized to -1.
Then, in the two places in the code where system is called, I replaced them
with code to see if externalProgramValue was still -1. If so, the
system command was executed and the value was stored in
externalProgramValue and used by the module. If externalProgramValue
was no longer -1, then the system command wasn't executed and the
earlier value was used.
However, this doesn't work because externalProgramValue needs to be
re-initialized to -1 everytime this module is used, and I can't
figure out how to do that.

--

Visit the Classic Home Games Museum at http://www.cs.unc.edu/~brownde/museum

 
 
 

External Authorization in Apache--runs too many times

Post by Marc Slemk » Fri, 12 Dec 1997 04:00:00



>I'm running Apache/1.2b7 on a Linux box.
>I downloaded a module for external authorization (from
>ftp://ftp.apache.org/apache/dist/contrib/modules/mod_auth_external.c)
>which runs gives an external program a username and password and
>waits for an exit value.
>When the username/password is *invalid*, everything works fine.
>The problem is when the username/password is *valid*. It seems this
>module runs my verification program 3-4 times. This is a problem because
>my program has a side effect of sending mail so I get the same mail sent
>3-4 times for one successful access.

How many requests are logged in the access log from the client?

If you have multiple files, eg. graphics on a web page, it will
need to be run for each and every one of those.  Web authentication
is passed for every request.

 
 
 

1. Apache/M$IE: IE doesn't send Authorization headers every time?

Hi:

From what I can understand, IE doesn't send Authorization
headers with every request, but only in the first request
in a particular connection ... Netscape, on the other
hand, appears to send them every time. What I don't understand
is how Apache does authorization, since in http_protocol.c,
conn->user is set to NULL at the start of every *request*,
not just every connection. So the user information is lost
on subsequent requests ...

Anyone know what's going on?

Rich.

--

Original message content Copyright ? 1999 Richard Jones

2. Is there a strtof() function (str to float)?

3. Running Apache from inetd with authorization

4. Compiling with test coverage options.

5. Running apache web server for the first time on MKLinux

6. How to change to Graphical interface on radhat linux7.1

7. Apache Configuration / Run-time error lists

8. AWE64 PnP

9. Large Run-time Memory Usage in Apache

10. wierd apache 1.2.5 run time error

11. Run Time Estimation of Apache 2.0 HTTPD

12. Trying to get Apache running for the first time ... some small progress!!

13. Apache 2 - How to set time (hour and minutes) to run rotatelogs script?