Solved

give access to a protected server to all clients?

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

More Than Just A Video Library

Train for your certification. Learn the latest DevOps tools. Grow your skillset to do better work.

At Linux Academy, we release new training modules every week so you'll always be up to date on the latest tech.

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…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

635 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