You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Phoebe Reed <pr...@pds.org> on 2003/10/28 15:38:05 UTC

use modperl to pass authentication to .htaccess


Hi All,

I use Basic authentication on part of my site, using an .htaccess file.
I would like to be able to pass a username/pass to this part of my site,
from a perl script.

So a user would type in their username and password into a cgi driven
form, and then the cgi would call a new page, that is in the
authentication required directory, and pass the username/password as
environment variables.  

I know how to get the username password in a perl script, after basic
authentication, but I do not know if it is possible to go the other way -
to give the username/pass to an .htaccess protected directory from a
script.  It seems like it should be easy.....

Any help would be much appreciated!

Thanks,
Phoebe Reed
preed@pds.org


Re: use modperl to pass authentication to .htaccess

Posted by John Saylor <jo...@worldwinner.com>.
hi

( 03.10.28 09:38 -0500 ) Phoebe Reed:
> I know how to get the username password in a perl script, after basic
> authentication, but I do not know if it is possible to go the other
> way - to give the username/pass to an .htaccess protected directory
> from a script.  It seems like it should be easy.....

it is, but not that way. if you have the username/password in your perl
script- then let perl authenticate them. if you must use .htaccess, you
can read the file into your script and do the necessary comparisons.
then, the perl script decide if it denies or completes the http request.

see ch.6 of the eagle book for more on this.

-- 
\js