Solved

Password Dialog

Posted on 1997-11-16
1
177 Views
Last Modified: 2013-12-25
I would like to display a password dialog, similar to the one displayed when you log onto Experts Exchange.  Can this be done in CGI
0
Comment
Question by:dl090597
1 Comment
 

Accepted Solution

by:
Rubyrhod earned 50 total points
ID: 1831269
The password dialog displayed at the Experts Exchange login is a feature of HTTP's "Basic Authentication" system. It is not created or invoked via CGI scripting, but by a Web server directive that instructs the server to use authentication. That said, it's true that most of the interesting things you might want to do involving basic authentication will require some CGI scripting. For example, the features at Experts Exchange that allow one to create a login/password pair and gain access to the site without human intervention on the part of the site's maintainers is almost certainly based on CGI scripts.

The method used to "turn on" basic authentication is going to depend on the particular Web server you're working with. If you're using NCSA's web server, or the Apache server based on it, it's pretty simple. Typically, you just create a file called ".htaccess" (the initial period is important) in the directory that you want to have protected, and place some text in that file telling the server how you want authentication to be applied. You also will probably need to use a program called "htpasswd" from the Unix command line to set the username/password pair(s) allowed in that directory; this information typically gets stored in some other directory in a file called ".htpasswd". Once this is set up properly, the server will prompt the user for a name/password pair whenever the user tries to access a document in the protected directory, allowing access if the name/password pair matches the stored information, and denying access if it doesn't.

An excellent tutorial on this is at NCSA's Web site. Check out http://hoohoo.ncsa.uiuc.edu/docs/tutorials/user.html if you're using NCSA's server or Apache. If you're using another type of server this tutorial may or may not be helpful; in that case you'll probably want to consult your server's documentation.

A good overview of this issue (which basically boils down to trying to create a "login" feature under the Web's HTTP protocol) is at the following address: http://www.webthing.com/tutorials/login.html

Good luck!


0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction This tutorial will give you a fast look what you can do with WhizBase. I expect you already know how to work with HTML at least, and that you understand the basics of the internet and how the internet works. WhizBase is a server-s…
It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now