In particular, this tutorial covers the basics of using the Argus Authentication server operated by ACS at the University of Kansas, including basic Web background material that will be useful for users just beginning to use Argus.
To understand browser-server interaction, you must first understand how Web clients and servers work together to deliver a "normal" HTML document. This is the "canonical" Web activity; the "usual" Web function. Then you need to understand how programs or "scripts" running on a server use the Common Gateway Interface (GCI) to receive requests from users and return documents customized to those requests. In addition, you need to know how web pages, scripts and servers can "redirect" a browser to a specific page when responding to a request for another page.
With this basic information, using Argus becomes straightforward.
The ultimate Argus reference can be found at: http://argus.cc.ku.edu/argus
The following diagram shows a WWW client running on a desktop
system, Computer A, interacting with two servers: An HTTP
server running on Computer B and an HTTP server running on Computer C.
The client running on Computer A gets a document, stored in a file
named docu1.html, from the HTTP server running on Computer B.
This document contains a link to another document, stored in a
file named docu2.html on Computer C.
The Uniform Resource Locator (URL) for that link might look something like:
http://ComputerC.domain/docu2.html
If the user activates that link, the client retrieves the file from
the HTTP server running on Computer C and displays it on the
monitor connected to Computer A.
The HyperText Transfer Protocol defines communication
between the client and an HTTP server. The following example
shows what an HTTP
exchange between a Lynx client and an HTTP server running
on Computer C might look like as the client fetches docu2.html.
The client sends the following text to server:
Finally, the client sends a blank line indicating it has completed
its request.
The server then responds by sending:
Things to note here:
The diagram below shows an hypertext
document on Computer B with a link to a file on
Computer C that holds the CGI program that will be executed
if a user activates the link.
This link is a "normal" http: link, but the file is stored in such
a way that the HTTP server on Computer C can tell that the file
contains a program that is to be run, rather than a document
that is to be sent to the client as usual.
When the program runs, it prepares an HTML document on the fly, and
sends that document to the client, which displays the document as it would any
other HTML document.
Such programs are sometimes called HTTP scripts
or "Common Gateway Interface" (CGI) scripts.
Note that CGI scripts may be written in scripting languages (like Perl,
TCL, etc.) or in any other programming language (like Java, C, Pascal, Basic).
On some HTTP servers these CGI programs are stored
in a directory called cgi-bin, and so they are also
sometimes called "cgi-bin scripts."
Here is a simple Perl program that can be run by an HTTP
server when it receives a request for the file containing the script.
When it runs, this program builds an HTML document containing the
current time and returns the document to the WWW client
that requested it.
The program is stored in a file named "date", in a folder
called "scripts". When a user activates a link that points
to this script, the Web client will generate an HTTP
request that might look like:
A set of tags was added to HTML to direct a WWW
client to display a form to be filled out by a user and then
forward the collected data to an HTTP server specified in the form.
To process such forms, servers were modified so that they could
start the CGI program specified in the form and pass the collected
data to that program, which could, in turn,
prepare a response (possibly by consulting a pre-existing database)
and return a WWW document to the user.
The following diagram shows the various components of the process.
In this diagram, the Web client running on Computer A acquires
a form from some Web server running on Computer B. It displays the
form, the user enters data, and the client sends the entered information
to the HTTP server running on Computer C. There, the data is handed off
to a CGI program which prepares a document and sends it to
the client on Computer A. The client then displays that document.
When this form is "submitted" by clicking on the "Date" checkbox and the "Submit"
button, the information sent to www.ku.edu by the client will resemble:
The MIME-type application/x-www-form-urlencoded means that the
variable name-value pairs will be encoded the same way a URL is
encoded. In particular, any special characters, including puctuation
characters, will be encoded as
Here is a Perl program that could process such a query:
The Canonical Browser-Server Interaction
During a "normal" document exchange a WWW client
(Netscape, Mosaic, Lynx, etc.) requests a document from a WWW server and
displays that document on a user display device.
If that document contains a link to another document, and
the user activates that link, the WWW client will then fetch and
display the linked document.
Executing "scripts"
An HTTP URL may identify a file that contains a program or script
rather than an HTML document. That program may be executed when
a user activates the link containing the URL.
Date information
\n";
print "The date is: $month $day, $year\n";
print "The time is: $time $daylight\n";
print "\n";
exit;
Date information
The date is: Dec 4, 2003.
The time is: 18:22:47 CST.
Executing a Script via an HTML Form
The ability to process fill-out forms within the Web required modifications
to HTML, Web clients, and Web servers (and eventually to HTTP, as well).
An example using a Post query
For example, suppose we want to use the script above to return EITHER the
date or the time at the user's request. To do that we would create an
HTML form like:
Select date OR time
%nn where nn
is the ASCII value for the character in hexidecimal.
(Note newer browser will probably use the MIME type "multipart/form-data"
in place of "x-www-form-urlencoded".)
Date information
\n";
# read the "date" parameter from the client.
if( $q->param( "date" ) eq "on" )
{
print "The date is: $month $day, $year.
\n";
}
# read the "time" parameter from the client.
if( $q->param( "time" ) eq "on" )
{
print "The time is: $time $daylight.\n";
}
print "\n";
exit;
Using the GET Method
Form data may be sent to scripts for processing by using the GET method
as well as the POST method. For example, the form tag in the example above could
have been encoded as