【发布时间】:2015-12-10 11:29:55
【问题描述】:
我正在开发一个需要使用 NTLM 身份验证与 IIS 服务器通信的 Windows 10 UWP 应用。我在 HttpBaseProtocolFilter 中设置用户名和密码:
filter.ServerCredential = new PasswordCredential(uri, UserName, Password);
当我在提琴手中查看请求时,它使用的是基本身份验证。有什么办法可以让它使用服务器需要的 NTLM?
请求标头:
Content-Length: 1459
Content-Type: text/xml; charset=utf-8
Host: server
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: ClientId=XXXXXXXXX
Authorization: Basic XXXXXXXXX
响应标头:
HTTP/1.1 401 Anonymous Request Disallowed
Server: Microsoft-IIS/8.5
request-id: xxxxx
WWW-Authenticate: NTLM
WWW-Authenticate: Negotiate
X-Powered-By: ASP.NET
X-FEServer: XXXXXXX
Date: Thu, 03 Dec 2015 16:12:58 GMT
Content-Length: 0
Proxy-Support: Session-Based-Authentication
【问题讨论】:
-
您的代码适用于 NTLM。你能发布以前的 Fiddler 请求和响应吗?
-
注意:我正在设置密码凭据的用户名,格式为:
{domain}\{username}
标签: c# authentication uwp windows-10-universal