我们有一个 ClickOnce WPF 应用程序,它通过 WCF 与服务进行通信。
去年某个时候,客户端在初次未经授权的尝试后正确地使用身份验证与服务进行通信:
2012-09-20 18:19:08 {ip address} POST /MyService/MyService.svc - 80 - {other ip address} - 401 2 5 0
2012-09-20 18:19:10 {ip address} POST /MyService/MyService.svc - 80 DOMAIN\USERNAME {other ip address} - 200 0 0 2279
但是,最近它不再尝试对自己进行身份验证:
2013-02-08 11:27:09 {ip address} POST /MyService/MyService.svc - 80 - {other ip address} - 401 2 5 1
2013-02-08 11:27:09 {ip address} POST /MyService/MyService.svc - 80 - {other ip address} - 401 1 2148074254 202
据我所知,配置在此期间没有更改。
WPF 客户端应用程序的配置设置为:
<basicHttpBinding>
<binding name="BasicHttpBinding_IShipRecService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="01:00:00" sendTimeout="00:00:15"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
和服务器:
<basicHttpBinding>
<binding name="basicBinding">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows" />
</security>
</binding>
</basicHttpBinding>
所以这里有一些奇怪的事情:
这些配置上的安全模式不匹配。但是,它们应该:客户端/Web 应用程序的实时实例可以使用此设置。此外,调整 web.config 以匹配并不能解决此问题。
我们还有一个与 WPF 客户端应用程序具有相同配置的 Web 应用程序。这能够与服务通信。我在这里看到的唯一区别是它们在同一个盒子上。
在 IIS 7.5 中,为服务禁用匿名身份验证并启用 Windows 身份验证。
关于阻止客户端应用程序尝试 Windows 身份验证的任何想法?或者我该如何进一步调查?