Solved

Password Dialog

Posted on 1997-11-16
1
181 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you get a (Blue Screen of Death), your system writes a small file called a minidump. Your first step is to make certain your computer is setup to record memory dumps. Right click My Computer, choose properties. Click on the advanced tab, an…
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
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…

739 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