When an HTTP server successfully fulfills a request, it returns an status code 200 indicating success. A CGI can override this default status code by returning a
Status: xxx
line in the header parameter. The CGI can also specify other header lines that
should be returned with the HTTP reply.
When a CGI want's to authenticate a user, it can check the REMOTE_USER and
REMOTE_IDENT environmental variables. If they don't exist or are not acceptable,
the CGI can return a 401 reply, indicating that a password is required.
The full header should be:
Status: 401 error message
WWW-Authenticate: Basic realm="name"
The first line tells the server to return a 401 reply code.
The second line specifies the authentication method (currently only Basic
is supported) and the text with which the user should be prompted for a password.
Example: | User | JOHN |
Password | john |