I am using the following code to prepare a handler for HttpClient:
var uri = new Uri("URL");
var credentialsCache = new CredentialCache();
credentialsCache.Add(uri, "NTLM", new NetworkCredential("username", "password"));
var handler = new HttpClientHandler() { Credentials = credentialsCache, PreAuthenticate = true };
handler.ClientCertificateOptions = ClientCertificateOption.Manual;
handler.ServerCertificateCustomValidationCallback =
(httpRequestMessage, cert, cetChain, policyErrors) =>
{
return true;
};
....
new HttpClient(handler);
Is it possible to avoid using real username and password?
Thanks