使用 RestSharp 请求带有 Windows 身份验证的 URL

mhe*_*abi 8 asp.net asp.net-mvc restsharp

我在 IIS 中有一个网站,其身份验证模式设置为Windows.
我需要使用restsharp调用该站点中的 URL :

var client = new RestClient(item.Url);
var request = new RestRequest("/account/Menu", Method.GET);
request.AddParameter("SSO_Token", token);
client.PreAuthenticate = false;
client.Authenticator = new RestSharp.Authenticators.NtlmAuthenticator(new NetworkCredential(username, password, domain));
// I also tried following codes with no luck:
// client.Authenticator = new RestSharp.Authenticators.NtlmAuthenticator();
// client.Authenticator = new RestSharp.Authenticators.NtlmAuthenticator(username, password);
var response = client.Execute(request);
Run Code Online (Sandbox Code Playgroud)

现在的问题是我收到此错误:

HTTP Error 401.1 - Unauthorized
You do not have permission to view this directory or page using the credentials that you supplied.
Run Code Online (Sandbox Code Playgroud)

我确定提供的凭据是正确的。