I have a very simple console app using an HttpListener to listen for incoming
HTTP requests (see code below). My client and server machines are both in an
ADS domain and I'm logged into both using my domain account. The server app
is running as admin on an XPSP2 box. If I set authentication to Anonymous or
Basic, I can get requests. If I change to IntegratedWindowsAuthentication,
however, IE on the client prompts me for credentials. I can get through using
an account on the server, but I really want it to just authenticate me as the
domain account I'm logged in on the client. I can do a secure TCP remoting
call between machines as well as use Windows Auth for an IIS web share. This
should work no problem, so am I missing some simple config setting?
HttpListener listen = new HttpListener();
listen.Prefixes.Add("http://*:8111/");
listen.AuthenticationSchemes =
AuthenticationSchemes.IntegratedWindowsAuthenticat ion;
listen.Start();
HttpListenerContext ctx = listen.GetContext();
byte[] buffer = System.Text.Encoding.UTF8.GetBytes("<HTML><BODY>
Success</BODY></HTML>");
resp.ContentLength64 = buffer.Length;
resp.OutputStream.Write(buffer, 0, buffer.Length);
resp.OutputStream.Close();
listen.Stop();