Re: HELP - hiding basic http authentication



Thanks ZeldorBlat - this helped conceptualize things a little better.
However, it does mean there isnt a way of logging in for the client,
which is still a problem.. as the content we would be grabbing on
behalf of the client would be a video stream. I had read about a
function in java that does a pre-authorization for the client, but
there dosent appear to be a corresponding php tool to do so.

a


ZeldorBlat wrote:
phoe2693@xxxxxxxxx wrote:
Im in desperate need of help! Anyone have a solution to this problem?

polling live images from a webcam with a basic authentication popup -
for display on my webpage.

friends login to the site first, and i want to have the scripts login
to the camera so the user dosent get the password. (so they dont mess
up my settings etc). Ive tried everything I can think of -

1)setting the $_SERVER['PHP_AUTH_USER'] and corresponding pass and
authtypes arrays

2)using an ajax HTTPObject javascript to pre-send them

3) using the PEAR lib HTTP_Request with the following code:

require_once "HTTP/Request.php";

$req =& new HTTP_Request("http://cameraurl/";);
$req->setBasicAuth("login", "pass");

$response = $req->sendRequest();

if (PEAR::isError($response)) {
echo $response->getMessage();
}
else {
// we should be able to show the page now, without login
popups... but does not work
headers("Location: http://mypage.com/loggedin";);
}


Someone MUST have already bypassed this - its such a simple thing but
its a complete deal breaker... HELP PLEASE - how can i get rid of the
popup in a php script before i visit the camera page?

You're on the right track with the PEAR stuff. But remember, that
request is made by the web server to the webcam. It has nothing to do
with the request from your user's browser to the webserver.

What you want is something like this:

Browser request a webpage from the server.
Server makes a request to the camera with the username and password.
Server returns the image from the camera to the browser.

So something like this:

$req =& new HTTP_Request("http://cameraurl/";);
$req->setBasicAuth("login", "pass");

$response = $req->sendRequest();

if (PEAR::isError($response)) {
echo $response->getMessage();
}
else {
//$response has the image from the request to the camera:
echo $reponse; //send it to the user's browser
}

.



Relevant Pages

  • Re: openssl from tcl
    ... "gets $fp" to retrieve the request from the web browser. ... I send a response back to the browser, using "puts $fp 'html data'", ... Because you made the client connect to localhost, ...
    (comp.lang.tcl)
  • Re: Which way to go?
    ... > which has a browser available. ... profile) is sent to the client and the user would like to see ... graph figures) - this would entail making a server request every time, ...
    (comp.lang.java.programmer)
  • RE: DNS response Issue
    ... The browser depends on OS settings for name resolution. ... TCP/IP settings on the NIC point to the server for DNS ... >> 2 computers connected to the Switch (One a server another a client), ... >> client is removed from the LAN so any request from the client has to go ...
    (microsoft.public.win2000.dns)
  • Re: How to send response headers from proxy to browser?
    ... browser and redirect it to www.yahoo.com. ... should we do to send the response headers from proxy? ... I suspect that the problem is that you are not correlating what the client sees ... When you send your request to Yahoo, ...
    (comp.lang.java.programmer)
  • Re: breaking the model
    ... > The forms data then is in the Request object. ... HTTP Request; in this case, the form POST Request from the Page. ... client and server. ...
    (microsoft.public.dotnet.framework.aspnet)