Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ModPerl: ModPerl

A better way to handle multiple client authentication?

 

 

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded


tosh at 1200group

Nov 21, 2009, 3:45 AM

Post #1 of 2 (437 views)
Permalink
A better way to handle multiple client authentication?

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 Apache::AuthDBI.

PerlSetVar Auth_DBI_data_source DBI:mysql:clientA

This works great, but I am aware of the limitations and I would like to
set up some rules in the Apache config that accomplish this all without
.htaccess files in every directory for every client (gonna get tricky
around 100,000 clients for sure!)

Is this even possible? Can I do something like:

RewriteRule ^/(.+)/$ PerlSetVar Auth_DBI_data_source DBI:mysql:$1

Or do I have to create my own authentication module?

Thanks for any direction... And sorry if this is better for the Apache
mailing list, I'm always a bit uncertain which group I should ask first...

Tosh

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


dietbuddha at gmail

Nov 21, 2009, 10:11 AM

Post #2 of 2 (402 views)
Permalink
Re: A better way to handle multiple client authentication? [In reply to]

The documentation alludes to the variable 'pwd_whereclause'. If this
variable is set it will be used in the passwd query. I would try and
set it per client so that the query gets an additional where clause:

SELECT pwd_field FROM pwd_table WHERE uid_field = user AND client = clientA

^^^^^^^^^^^^^^^^^^^^^^^^

I havn't actually tried this so I don't know if there are any caveats,
but from the docs at least it seems possible. The only trick is
making sure you can reset the pwd_whereclause with each different
client url, and make client an additional column in your pwd_table.

--
-wjt

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.