perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tosh Cooey <t...@1200group.com>
Subject Replacement for Apache::AuthDBI but not mod_authn_dbd
Date Mon, 07 Dec 2009 00:52:13 GMT
If you saw my last post I described my solution for the following problem:

Right now I have an application set up for multiple clients: clientA, 
clientB, clientC.

Each client has their own users.

The way I have it setup is clientA goes to http://www.site.com/clientA 
and is presented with a login screen which is triggered by an .htaccess 
file in a directory called /clientA. The .htaccess file directs Apache 
to perform DBI-based authentication using Apache2::AuthCookieDBI.

The solution was to subclass Apache2::AuthCookieDBI (MyAuth.pm) to have 
it dynamically set the $database variable on each request depending on 
the client.

This works great, but now MyAuth.pm needs to be a bit more complicated 
to be able to handle BASIC Authentication as well, for example in this 
scenario:

http://www.site.com/clientA/calendar
http://www.site.com/clientA/calendar/ical

The first link is handled by a login screen and cookies.  The second 
would allow programs like iCal to subscribe to a calendar and so needs 
to be handled via BASIC Authentication.  My initial thought was that 
this would be easy, I would just do the following:

package MyAuth;

if ($var eq 'iCal') {
   use base "Apache::AuthDBI";
   ... do some other stuff...
} else {
   use base "Apache2::AuthCookieDBI";
   ... do some other stuff...
}


But if I'm not mistaken Apache::AuthDBI is a mp1 module not mp2 because 
all it's functionality is managed by mod_authn_dbd and also it's for 
Apache 1.3 which is great but doesn't help me in my above scenario.

Anyone have any suggestions for a Apache::AuthDBI replacement?  Or 
perhaps a different way to accomplish what I want?

Thanks!

Tosh
-- 
McIntosh Cooey - Twelve Hundred Group LLC - http://www.1200group.com/

Mime
View raw message