Solved

Password Dialog

Posted on 1997-11-16
1
180 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

The New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

Question has a verified solution.

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

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…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
The viewer will learn how to count occurrences of each item in an array.

821 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