Solved

Password Dialog

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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

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 will show, step by step, how to integrate R code into a R Sweave 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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

705 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