Bruce Johnson wrote:
I'm looking at the code at the modperl.com site <http://www.modperl.com/book/chapters/ch6.html> ('Authenticating against a database') as I need to write an authentication handler for our site.

This is part of the sample code:

# file: Apache/GateKeeper.pm
use strict;
use Apache::Constants qw(:common);
sub handler {
my $r = shift;
my $gate = $r->dir_config("Gate");

for mod_perl2 do I just use

Apache2::Const qw(:common);

and use the rest of that code as a model or will I run into other issues?


You can of course use it as a model.
And you will certainly run into many issues, because web server authentication is more complex than it might look at first.

I would recommend an alternative approach to you :

1) check in CPAN what already exists as AAA modules for Apache. Chances are overwhelming that you will find already done, what you are trying to do. 2) Even if you do not find exactly what you need, try to find an existing module and modify it, carefully, rather than starting from scratch. 3) Even if you do not want to do that, read the documentation of some of the existing modules. It is probably the best introduction to web AAA that you'll ever find.

That is one of the benefits of Perl and Open Source : all these things that others have already spent a lot of time and energy perfecting, are available to you for perusing, re-use and for further refinement.

Start your search here :
http://cpan.uwinnipeg.ca/search?query=apache+auth&mode=chapter




Reply via email to