I have a Web API which uses .NET core 2.2 and HTTP.Sys. I've setup Windows authentication and I can see the 401 WWW-Negotiate challenge followed by 200 when the user is authorized.
Now I've performed the same request several times but I see the challenge is happening for every request, slowing down the system and affecting performance. My sample client:
var httpHandler = new HttpClientHandler
{
UseDefaultCredentials = true,
Proxy = new WebProxy
{
Address = new Uri("http://HOSTNAME:8888"),
}
};
using (var client = new HttpClient(httpHandler))
{
client.BaseAddress = new Uri("http://HOSTNAME:5000/");
for (int i = 0; i < 10; i++)
{
try
{
HttpResponseMessage response = client.GetAsync("api/user").Result;
response.EnsureSuccessStatusCode();
string result = response.Content.ReadAsStringAsync().Result;
Console.WriteLine("Result: " + result);
}
catch (System.Exception ex)
{
Console.WriteLine(ex);
}
}
I read that for IIS it seems you can use authPersistNonNTLM=true
here, but I couldn't fine a similar setting for pure HTTP.sys. any idea?
Thanks,