我有Windows身份驗證的WCF服務。它部署到另一臺服務器後,我收到了以下異常:WCF Windows身份驗證在部署後不起作用
System.ServiceModel.Security.MessageSecurityException: The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Negotiate,NTLM'. ---> System.Net.WebException: The remote server returned an error: (401) Unauthorized
客戶端配置沒有改變,看起來是這樣的:
<ws2007HttpBinding>
<binding name="autoSecureBinding">
<security mode="TransportWithMessageCredential">
<transport clientCredentialType="Windows" proxyCredentialType="None" realm=""></transport>
<message clientCredentialType="Windows" negotiateServiceCredential="true" establishSecurityContext="false"/>
</security>
</binding>
</ws2007HttpBinding>
編輯:當我在瀏覽器中打開我的服務我收到以下錯誤:
Security settings for this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service.
有誰知道這可能是個問題?
啓用Windows身份驗證並禁用匿名。 新的服務器在同一個AD域中。 –
嗯,顯然錯誤消息狀態,應該啓用匿名...不知道是否啓用是一個好主意。 –