[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Authentication
Once one gets mod_perl installed in a web server, for instance, a lot of
opportunities open up. One of the coolest things about mod_perl is that
stuff written in perl can literally be integrated into the web server.
From the perldoc on Apache::AuthenDBI:
__________CUT HERE__________
Apache::DBILogin - authenticates via a DBI connection
SYNOPSIS
See the access.conf file and the documentation for
Apache::AuthenDBI
#in .htaccess
AuthName MyAuth
AuthType Basic
PerlHandler Apache::Registry::handler
PerlAuthenHandler Apache::DBILogin::handler
AddHandler perl-script pl
PerlSetVar Auth_DBI_data_source dbi:Oracle:SQLNetAlias
#PerlSetVar Auth_DBI_authz_command "SET ROLE DBA"
Options Indexes FollowSymLinks ExecCGI
AllowOverride All
allow from all
require valid-user
satisfy all
DESCRIPTION
Apache::DBILogin allows authentication against a multi-
user database. It is intended to facilitate web-based
transactions against a database server as a particular
database user. If you wish authenticate against a passwd
table instead, please see Edmund Mergl's Apache::AuthenDBI
module.
Auth_DBI_authz_command is an optional valid database
command, executed via the DBI do method. In the above
example I take advantage of Oracle roles, a set of
priviledges which can be assigned to groups of users.
__________CUT HERE__________
This means, simply put, that any database with a DBD driver available
can be used to authenticate against.
This is but one facit of the true power of mod_perl: with it, the full power
of a fast interpreted language lives in your web engine. Check out:
ftp://www.perl.com/pub/perl/CPAN/modules/by-module/Apache/
for a large list of cool stuff you can do with mod_perl. It is truly
astonishing. It has really been worth my while, at work, to read through
the hundreds of perl modules on CPAN. The time I've saved by knowing what
modules are available is substantial, especially on time critical projects.
Cheers.
-Dana
-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,
Dana M. Diederich Phone: 1.501.855.7175
SMTP: dana@realms.org HTTP: http://realms.org/ ICQ: 16433785
Snail Mail: 19 Leicester Drive, Bella Vista, Ar 72714, USA
`Berkeley invented LSD and Unix, and I don't think that's a coincidence.'
>
> > Negative mucacho. Neither Perl nor PHP support HTTP auth. HTTP auth
> > occurs *BEFORE* the CGI gets executed. Only modules support http auth.
>
> Well... PHP *is* a module...
> If we can overcome the issues of doing http auth from MySQL then I'm OK
> with it. I don't want to run yet another DB and introduce that and it's
> overhead...
>
> I don't think http auth would change our model too much (article
> commenting, etc.)
>
> > > Also, I still haven't figured out how to check passwords with MySQL. I
> > > haven't looked much since the last time I asked. But if someone has
> > > some code, that would be great.
>
> What do you mean by check passwords? If you were verifying a users
> password you would do something like this:
>
> select Password from Users where Handle = '<? echo handle ?>';
>
> and then compare password(what user enters) to the Password returnerd by
> the query (without passing it thru the password() function.
>
> Jason
>