Solved

give access to a protected server to all clients?

Posted on 1997-06-26
3
185 Views
Last Modified: 2013-12-25
Is it possible to give access to a username/password protected server without asking all users a password?

Here's the scheme:

clientA ---}
clientB ---}-open--> serverA  ---protected----> serverB
clientC ---}

clientD --------------------------------------> serverB

I want to give access to serverB to anyone who accesses serverA. If you're allowed to access serverA, serverB is OK also.

But it should not be possible to access serverB directly.

It seems that installing a proxy-server could do the job, but that seems a little overkill to me, since proxy-servers can do much more.

I was thinking of writing a CGI-script that adds some a
Authorize: xxxxxxxxxx header to the request to serverA and resend it to serverB.

Is this possible and how should it be done?
0
Comment
Question by:haayman
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
Philippe earned 100 total points
ID: 1828585

haayman,

A simple way to give access to a procted server (B) from another server (A) is to set up a cgi script that uses a program to download the pages from B. I have done this using lynx (you can get lynx from http://www.crl.com/~subir/lynx.html ). Lynx will set up the Authorize string for you download the document and output the html.

You can use a .htaccess file to protect the documents on B and the cgi script on A. If your server doesn't allow you to protect cgi scripts, see my answer to mismith in this same topic
 http://www.experts-exchange.com/topics/comp/www/cgi//Q.8630008825

Here is a simple shell script (make that a batfile if you're on nt/95). "username:password" are the username and password required to access the documents on B.


#/bin/sh
echo "Content-type: text/html"
echo
 
lynx -source -auth=username:pw http://www.B.com/protected_stuff


  hope this helps,

    Philippe

0
 

Author Comment

by:haayman
ID: 1828586
It partly works.
But how do I handle all references in the returned HTML to e.g. pictures etc.?

e.g.
Through the CGI-script I get a HTML-file back like:

<html>
<img src=/pictures/img.gif>
<form action=/cgi-bin/action.cgi>
...
</html>

How should I handle these URL's? The client expects these to be present at server A.

0
 
LVL 2

Expert Comment

by:Philippe
ID: 1828587

Haayman,

I would do the follwoing, supposing your server A is a unix machine. Run the output of lynx through sed to replace relative URLs and absolute URLs pointing to B with a URL pointing to the cgi script on A with the orginal url as parameter. Note that you'll have to use the -mime_header option of lynx since not all documents will be html.

If your system really is unix and if you're not familiar with sed I could write the script for you tomorrow, if you put it up as a question

I hope this helps, it's all I can do today.

  cheers,

    Philippe


0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
This article will show, step by step, how to integrate R code into a R Sweave document
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

809 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