Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: mod_perl handler for file downloads: good call or bad

by clinton (Priest)
on Jun 20, 2007 at 16:37 UTC ( #622314=note: print w/ replies, xml ) Need Help??


in reply to mod_perl handler for file downloads: good call or bad

I second Fletch's recommendation of the PerlAuthzHandler.

You COULD serve the files via mod_perl (using $r->sendfile($filename) ), but apache does it faster, so I would rather get out of the way and let it do its thing.

Clint


Comment on Re: mod_perl handler for file downloads: good call or bad
Re^2: mod_perl handler for file downloads: good call or bad
by Errto (Vicar) on Jun 20, 2007 at 18:18 UTC
    Sorry for not mentioning this in the OP, but I don't think I can use an Authz handler, because that seems to require using HTTP authentication, whereas I have my own mechanism for dealing with the "who" aspect.
      You can do anything you like in the PerlAuthzHandler, including returning a login page - HTTP authentication is just how apache implements it by default

      Clint

        I've been looking over the link sent by Fletch and it really doesn't look like that's the case. The Authz seems to depend on a successful pass of the Authen pahse, which in turn requires the directory to be protected with either Basic or Digest authentication as configured in httpd.conf My application uses neither Basic nor Digest authentication but rather a third-party authentication module that communicates the user ID in a custom manner. The issue is not showing a login page but rather that I have to reject the request if the user ID (as determined through my custom method) should not have access to the resource.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (15)
As of 2014-10-23 15:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (125 votes), past polls