Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

give access to a protected server to all clients?

Posted on 1997-06-26
3
Medium Priority
?
191 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
[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
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
Philippe earned 300 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

Introduction This tutorial will give you a fast look what you can do with WhizBase. I expect you already know how to work with HTML at least, and that you understand the basics of the internet and how the internet works. WhizBase is a server-s…
In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

722 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