CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Intermediate:
Username and Password...



Feb 29, 2000, 2:45 PM

Post #1 of 7 (3824 views)
Username and Password... Can't Post

I am writing a login script to be used in conjunction with .htaccess security. I need to know if the username and password can be sent with the redirect in my script as to avoid the user from having to enter it again.

I am redirecting from the script to the secure directory use the location command. That works fine, but I don't want it to then prompt for a username and password, I want to send that info along with the redirect…

Anyone know if this can be done?

Thanks everyone…


Mar 1, 2000, 10:33 PM

Post #2 of 7 (3824 views)
Re: Username and Password... [In reply to] Can't Post

Well you could try this:

print "Location: username:password@" , "\n\n";

I know that if you put the username:password@ you can access a secured directory with most browsers. However I am not to sure on how secure this would be. But it might help.


Mar 2, 2000, 8:42 PM

Post #3 of 7 (3824 views)
Re: Username and Password... [In reply to] Can't Post

What is it that is being protected?
Is it absolutely necessary for this area to be accessed?
What I'm getting at is this. I recently did a site where there was information being added to and deleted from a text database that consisted of a series of files working together. These files were kept in one directory that was protected using htaccess and a password file. The information can only be altered here, but is viewable by anyone through scripts running above that directory. These scripts can bypass htaccess and get the info, but only authorized users can modify the info.
Have you thought about doing something in that manner?

- Keith


Mar 3, 2000, 6:31 AM

Post #4 of 7 (3824 views)
Re: Username and Password... [In reply to] Can't Post

Well, it does have to be read accessable to the users. The purpose of the script that I am writing is to control mutiple logins. (In an attempt to prevent password sharing.)

I want them to have to login to the secure area through the login script and not by going directly to the secure area with their browsers.

Idealy, I would use a referer statement in the htaccess file, however the host running the sight is only using HTTP/1.0 and it does not support the referer option in that version. So I am trying to put together some kind of work around...

Does that help explain the problem?

any help is appriciated...

Note: the first sugestion, username:password@, did not work. But thank for trying, it is apriciated...


Mar 19, 2000, 1:15 AM

Post #5 of 7 (3824 views)
Re: Username and Password... [In reply to] Can't Post

I have been searching for this with no luck so far. Did you found a way to access a passworded directory (with htaccess) through a cgi script without having the user input the password again?

I am still looking. If I find something I let you know...



Mar 19, 2000, 9:02 PM

Post #6 of 7 (3824 views)
Re: Username and Password... [In reply to] Can't Post

if you want to use .htaccess you must see script " members manager " form to have an idea


Mar 21, 2000, 7:00 PM

Post #7 of 7 (3824 views)
Re: Username and Password... [In reply to] Can't Post

OK, I think I see what you're doing.
You could give folks access to this area using htaccess. If you want the script to be able to see what they're name is, use the Environment variable, $ENV{'REMOTE_USER'} which is the username they enter into the password dialog box generated on a password protected directory.

That way you have a link to the directory, they login when the box comes up, the script takes over from there. Your script will still know who is logged in and no need to reenter the password later.

Hope this helps. Not 100% sure it will work for your situation.



Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives