perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tosh Cooey <>
Subject Howto Apache2::AuthCookieDBI and followup question
Date Fri, 30 Sep 2016 22:16:59 GMT
Ok, so it seems with Apache > 2.4 the functionality of 
Apache2::AuthCookieDBI can be duplicated using modules, specifically:

mod_auth_form AND mod_authn_dbd

This article gives a good writeup about it:

In the config file you just need:

DBDriver mysql
DBDParams "dbname=myDB,user=root,pass=XXX"
<Location /private>
   AuthFormProvider dbd
   AuthType form
   AuthName private

   Session On
   SessionCookieName session path=/
   SessionCryptoPassphrase secret
   ErrorDocument 401 /login.html

   # mod_authz_core configuration
   Require valid-user

   # mod_authn_dbd SQL query to authenticate a user
   AuthDBDUserPWQuery "SELECT password FROM apache_user WHERE username = %s"

Now the followup. I personally need extra dynamism, specifically I need 
DBDParams and SessionCookieName to be dynamic for each request. Intense 
googling has lead me to believe I can do so within a <Perl> block, 
something like:

When the user requests*anything* then 
the <Perl> block needs to get $client_identifier from the URI and then 
get $host, $database, $username, $password via:

select host, database, username, password from clients where client = 

But I'm kind of at a bit of a loss how to accomplish this. Anyone here 
have any hints?

Thanks, and I hope this helps rescue people from Apache2::AuthCookieDBI


McIntosh Cooey - Twelve Hundred Group LLC -

View raw message