tune has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks on the Wall :-)

I have a special problem. I have a huge database (about 1 million records) in mysql which should be used for Apache authentication. It is clear til this point, there is an Apache-Mysql-Auth (or similar named) module, which I have to explore.
The database contains costumer IDs, which are 13 characters long. The requirement is the following: "every second characters of the ID should be the password". I am not sure if I could figure it out with that Apache module. Maybe I have to use cookie + perl authentication (toooooo bad!!! I mean the cookie part :)) in this application. Please dont hesitate to shoot me with your ever outstanding ideas.
TIA

-- tune

Replies are listed 'Best First'.
Re: Apache authentication with Mysql
by rpc (Monk) on Mar 29, 2001 at 23:03 UTC
    If you're using mod_perl, you can setup a PerlAuthenHandler in place of AuthBasic. You could then write an authentication handler that fires off a db query to check for a valid logon.
Re: Apache authentication with Mysql
by busunsl (Vicar) on Mar 30, 2001 at 01:27 UTC
    Well, if 'Apache-Mysql-Auth' won't fit your needs, you definitely have to read the Eagle, 'Writing Apache Modules with Perl', O'Reilly.
    It contains EYEWTK about perl module for apache.
Re: Apache authentication with Mysql
by lachoy (Parson) on Mar 29, 2001 at 23:44 UTC

    If you don't want to go the mod_perl route, mod_auth_mysql might be the ticket. It's pretty simple to setup and uses few resources. However, to use it in your situation you'll need to create a separate password field rather than derive a computed value from the username field. If you can't do this then creating an authentication handler in mod_perl is pretty simple.

    mod_auth_mysql uses http authentication rather than cookie-based. I've used the module with good success for quite some time. Google turned up a good HOWTO for using it.