Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: Re: Re: mod_perl web app design considerations

by andye (Curate)
on Sep 04, 2002 at 01:50 UTC ( #194965=note: print w/ replies, xml ) Need Help??

in reply to Re: Re: mod_perl web app design considerations
in thread mod_perl web app design considerations

But for this to work, wouldn't I have to implement my own Apache module to intercept requests and do authentiation and authorization based on the value of the requested URI?

Rather happily, that's an awful lot easier than it sounds. A skeleton authentication handler looks like this:

package Apache::AuthAny; # file: Apache/ use strict; use Apache::Constants qw(:common); sub handler { my $r = shift; my($res, $sent_pw) = $r->get_basic_auth_pw; return $res if $res != OK; my $user = $r->connection->user; unless($user and $sent_pw) { $r->note_basic_auth_failure; $r->log_reason("Both a username and password must be provided +", $r->filename); return AUTH_REQUIRED; } return OK; } 1;
(that'll authenticate on the *presence* of both a username and password, via HTTP Basic Auth - obviously you'd want to substitute a real-world authentication scheme).

The Eagle book gives full details, and some of it seems to be online here:
(found through random Googling).

hth, andye.

Comment on Re: Re: Re: mod_perl web app design considerations
Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://194965]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (13)
As of 2014-07-25 16:53 GMT
Find Nodes?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:

    Results (174 votes), past polls