I am having a problem with NTLM authentication on Owin selfhosted Web Api. NTLM is enabled on both server and client side. In client I am using RestSharp.
Client
_client = new RestClient(ConfigurationManager.AppSettings["UserAccessApi"]);
_client.Timeout = 5000;
_client.Authenticator = new NtlmAuthenticator();
Service
var listener =
(System.Net.HttpListener)app.Properties["System.Net.HttpListener"];
listener.AuthenticationSchemes = System.Net.AuthenticationSchemes.IntegratedWindowsAuthentication;
app.UseWebApi(config);
If I access this API via IP or Chrome browser it just works, while if access it through hostname or internet explorer, it does not. I assume this is related to restsharp using httpclient which uses IE engine, which in our company has some local/public networks security settings which are getting in a way for IE. Anybody had similar issue and have any idea how to overcome it without going the "Change IE settings" way?
HostName based call header
IP Based call header
Fiddler log, 1st batch - hostname call, 2nd batch - ip
Using AuthenticationSchemes.Ntlm should help. But it's more like a workaround, as it'll be forcing Ntlm.