in reply to loggin into an Apache htprotected folder via CGI script.

If I am understanding what you are trying to do, you may wish to look at the credentials() function in LWP::UserAgent. You can find some information regarding the function in Chapter 5 of Web Client Programming in Perl, which is available online thru O'Reilly and Associates's Open Books Project.

If I am wrong on what you are trying to do above, the only other way I see it is to have the script they go thru return the contents of the page it logs into (with the authentication information) with all links rewritten so as to pass thru the script, so that the script acts as a proxy for retrieving the directory.

Update: You may want to look for either an Apache module or mod_perl solution to managing access to that content. Just a thought.

  • Comment on Re: loggin into an Apache htprotected folder via CGI script.

Replies are listed 'Best First'.
Re: Re: loggin into an Apache htprotected folder via CGI script.
by thunders (Priest) on Jun 27, 2002 at 18:59 UTC

    Ok, I'd best clarify. How I do this is not set in stone, I'm totally open to other options. My goal is to have a directory full of stuff that isn't easy for just anyone to access. I already well on my towards implementing a system where people apply to look at some information, their application is stored in a database and potentially approved. In this same database I have an encrypted password for this user.

    Ok, so an administrative type sets a flag in the database, now we have some approved users, they have usernames and a password.

    These users can now log in via a CGI login screen. Is there a way to allow only these logged on users access to certain documents?(ideally a bunch of static HTML pages and a few dynamic cgi pages)