I have a WCF HTTP REST Service and I tie into it with an HTTP client in a different programming language who writes its own custom HTTP. I would like to add WWW-Authenticate
Just to add to this, Chrome will not load the login dialog unless you change "BasicRealm" to "BasicRealm=site" in the OnEndRequest method:
public void OnEndRequest(object source, EventArgs eventArgs)
{
if (HttpContext.Current.Response.StatusCode == 401)
{
//if the status is 401 the WWW-Authenticated is added to
//the response so client knows it needs to send credentials
HttpContext context = HttpContext.Current;
context.Response.StatusCode = 401;
context.Response.AddHeader("WWW-Authenticate", "Basic Realm=site");
}
}
And thanks, this is such a simple solution.