Thanks! That worked a treat. <div><br></div><div>Here's an example of what I did:</div><div><br></div><div><div>if ( !isset($_SERVER['PHP_AUTH_USER']) || !$_SERVER['PHP_AUTH_USER'] )</div><div> <span class="Apple-tab-span" style="white-space:pre"> </span>{<span class="Apple-tab-span" style="white-space:pre"> </span></div>
<div> <span class="Apple-tab-span" style="white-space:pre"> </span>header('WWW-Authenticate: Basic realm="Auth"');</div><div> <span class="Apple-tab-span" style="white-space:pre"> </span>header('HTTP/1.0 401 Unauthorized');</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>header('HTTP/1.1 401 Unauthorized');</div><div> <span class="Apple-tab-span" style="white-space:pre"> </span>echo("Please enter a valid username and password");</div>
<div> <span class="Apple-tab-span" style="white-space:pre"> </span>exit(); </div><div> <span class="Apple-tab-span" style="white-space:pre"> </span>}</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>else {</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>if (!$this->authenticate($this->input->server('PHP_AUTH_USER'), $this->input->server('PHP_AUTH_PW'))) </div><div><span class="Apple-tab-span" style="white-space:pre"> </span>{</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span> $this->output->set_header('Location: http://'. HOSTNAME .'/ipxeboot/');</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>}</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span> else { // user logged on - redirect to the menu system</div><div> .... etc. etc.</div><div><br></div>Thanks again for the pointer. I was going crazy trying to figure it out. </div>
<div><br><div class="gmail_quote">On Fri, Aug 17, 2012 at 3:04 AM, Michael Brown <span dir="ltr"><<a href="mailto:mbrown@fensystems.co.uk" target="_blank">mbrown@fensystems.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Friday 17 Aug 2012 07:59:23 Jim Antoniou wrote:<br>
> I've dumped the tcp stream on the web server and don't see any indication<br>
> that the username is showing up in it after I hit enter. With the old iPXE<br>
> binary, I see the username show up in the tcp dump.<br>
><br>
> Ideas on how I might troubleshoot this more? I am grasping at straws right<br>
> now.<br>
<br>
</div>I'm pretty sure the offending commit will be<br>
<br>
<a href="http://git.ipxe.org/ipxe.git/commitdiff/5f2226a" target="_blank">http://git.ipxe.org/ipxe.git/commitdiff/5f2226a</a><br>
<br>
As part of the changes to add support for HTTP DIgest authentication, iPXE now<br>
provides a username and password only if the server actually requests<br>
authentication (i.e. responds with a 401 Unauthorized response).<br>
<br>
Try adding the following code (taken from<br>
<a href="http://php.net/manual/en/features.http-auth.php" target="_blank">http://php.net/manual/en/features.http-auth.php</a>) at a suitable place within<br>
your PHP script:<br>
<br>
if ( ! isset ( $_SERVER['PHP_AUTH_USER'] ) ) {<br>
header ( 'WWW-Authenticate: Basic realm="My Realm"' );<br>
header ( 'HTTP/1.0 401 Unauthorized' );<br>
exit;<br>
}<br>
<br>
That should hopefully make everything work as expected.<br>
<br>
To improve security, you might also want to investigate the use of Digest<br>
authentication, since that avoids exposing the plaintext password on the wire.<br>
<span class="HOEnZb"><font color="#888888"><br>
Michael<br>
</font></span></blockquote></div><br></div>