Solved

give access to a protected server to all clients?

Posted on 1997-06-26
3
187 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 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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

Suggested Solutions

If you get a (Blue Screen of Death), your system writes a small file called a minidump. Your first step is to make certain your computer is setup to record memory dumps. Right click My Computer, choose properties. Click on the advanced tab, an…
It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

751 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