in reply to Basic HTTP Authentication

This is a server issue. Your code, via the server, sends the 401 Authentication Required Header. The browser responds to this with the prompt and it sends this data to the server.....all good so far. Now If you can't see it either the browser is not sending it (highly unlikely), the server is not making it available or you are looking in the wrong place. As a sanity check I would dump the contents of %ENV just to see if the data is there.

print '<pre>',map{"$_ => $ENV{$_}\n"}keys %ENV, '</pre>';

Replies are listed 'Best First'.
Re^2: Basic HTTP Authentication
by garyk83 (Initiate) on Nov 26, 2007 at 03:37 UTC
    Hi tachyon-II,
    I tried printing out all the results in $ENV and there was no REMOTE_USER or REMOTE_PASSWD in the printed results, I tested in Internet Explorer as well as Mozilla Firefox.
    Could there be something that needs enabling in apache to allow for the REMOTE_USER and REMOTE_PASSWD variables to be shown?

    Thanks,
    Gary
      Could there be something that needs enabling in apache to allow for the REMOTE_USER and REMOTE_PASSWD variables to be shown?
      Yes, it's my understanding that you have to use the basic auth Apache stuff. No level of triggering it from a user program will work, as noted in that 4-year-old thread you referenced as well. It doesn't do any good to trigger an "auth required" status from a CGI script.

      For Apache 2, the relevant module is mod_auth_basic, and numerous tutorials exist about how to configure it.

      You can try to log your session with LiveHTTPHeaders. I think this can help you to find the problem.