My computer is connected to the company AD. When I try to access certain REST API from Edge I am automatically signed in and I can access the API. I want to mimic this behavior from C#.
var clientHandler = new HttpClientHandler{
Proxy = GlobalProxySelection.GetEmptyWebProxy(), // the resource has direct access
UseDefaultCredentials = true,
// PreAuthenticate = false,
AllowAutoRedirect = false,
// UseCookies = true,
// CookieContainer = new CookieContainer()
};
var client = new HttpClient(clientHandler);
var result = client.GetAsync(URL).Result;
Console.WriteLine(result.StatusCode);
Console.WriteLine(result.Headers);
However this code doesn't work since it redirects my to ADFS sing-in page. Instead, I'd like it to use NTLM/Kerberos/SSPI/magic. I've been wrapping my head around it for weeks now, but nothing seems to work and I really need someone to put me in the right direction.