> >> >I am trying to get the REMOTE_USER environment variable so i can
> >> >query a database for that value, but it is null.
> >> >If I do a printenv on one page, it comes up as "ben" but when i write
> >> >a simple piece of C code to getenv("REMOTE_USER"); it returns a null
> >> >value...
> >> >Why is this so?
> >> Because you aren't requiring authentiation for the script?
> >I don't believe that you need to require authentication for the script itself. Once a
> >user authenticates (as I understand it) the browser caches this information and will
> >send it to the server, thus setting the REMOTE_USER environment variable. Is your C
> >code a CGI script, and are you executing it after the user has authenticated?
> If the script doesn't require authentication, it likely won't get
> it. It may, depending on the client, but there is no reason it
> should. If you don't require authentication for the script at
> least some clients will access it without authentication so you
> won't get REMOTE_USER. You need to require authentication for the
> script if you want access to be authenticated, period.
Yes, Marc has a good point. I guess the crux of the situation here is that in order to to
have REMOTE_USER set, you need to have the user authenticate before the script is run. As
Marc points out, the surest way to do this is to require authentication for the cgi script
itself. Now the question is, in your situation, has the user authenticated prior to
executing the cgi script and done nothing else to cause the browser to lose the cached
values (eg., quit the browser and restart it)?