Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Windows 2012R2上运行的IIS 8上的Web API基本身份验证问题_C#_Authentication_Asp.net Web Api - Fatal编程技术网

C# Windows 2012R2上运行的IIS 8上的Web API基本身份验证问题

C# Windows 2012R2上运行的IIS 8上的Web API基本身份验证问题,c#,authentication,asp.net-web-api,C#,Authentication,Asp.net Web Api,我有一个用c#WinForm开发的简单应用程序,它在开发过程中使用HTTPClient与Windows 10上IIS 10中托管的Web API进行事务处理。在开发计算机上测试是可以的。现在,我已将Web API应用程序移动到运行Win2012R2的生产服务器计算机上。我还将此生产IIS上的Web API配置为仅使用基本身份验证。我看到列出了其他IIS身份验证方案,包括摘要、表单、Windows、APS.Net模拟和匿名,并已禁用所有这些方案。但是,当我运行winform客户端应用程序时,我收到

我有一个用c#WinForm开发的简单应用程序,它在开发过程中使用HTTPClient与Windows 10上IIS 10中托管的Web API进行事务处理。在开发计算机上测试是可以的。现在,我已将Web API应用程序移动到运行Win2012R2的生产服务器计算机上。我还将此生产IIS上的Web API配置为仅使用基本身份验证。我看到列出了其他IIS身份验证方案,包括摘要、表单、Windows、APS.Net模拟和匿名,并已禁用所有这些方案。但是,当我运行winform客户端应用程序时,我收到401(未经授权)响应。我已经检查了我知道要做的所有设置和配置,但仍然收到此响应代码。我将Fiddler放在两者之间,并注意到响应身份验证与请求中包含的身份验证不同。示例如下:

请求标头:

POST http://rand22/PrevalonESB/api/Login HTTP/1.1
Authorization: Basic UFJFVkFMRU5U:cHJldmFsZW50Mg==
Content-Type: application/json; charset=utf-8
Host: rand22
Content-Length: 105
Expect: 100-continue
响应标题:

HTTP/1.1 401 Unauthorized
Server: Microsoft-IIS/8.5
WWW-Authenticate: Digest qop="auth",algorithm=MD5-sess,nonce="+Upgraded+v138ac47246a9c7aabad1bf83ec86a95adeeacf04e0386d20192a696ef815b0d8b0e2486e724a2f04263a31a6878bc69aa78e0e6a56f57be8b",charset=utf-8,realm="Digest"
WWW-Authenticate: Negotiate
WWW-Authenticate: NTLM
Date: Mon, 13 Feb 2017 14:13:11 GMT
Content-Length: 0
如果这里有人能帮我诊断发生了什么,我将不胜感激。我还想知道为什么响应头包含我为目标web api应用程序禁用的身份验证方案。 仅供参考:服务器计算机以前是域控制器,但已降级为成员服务器