使用本地SYSTEM帐户从Windows服务访问具有集成Windows身份验证的WCF服务

时间:2010-02-11 11:12:01

标签: wcf windows-services windows-authentication wcf-security wcf-client

我们使用在专用服务器上部署的集成Windows身份验证来提供WCF服务。 客户端计算机上将有Windows服务[Windows服务使用本地系统帐户]。当Windows服务中的WCFServiceClient访问WCF服务时,我们收到错误。[如果Windows服务在服务器计算机上,它工作正常]

System.ServiceModel.Security.MessageSecurityException: The HTTP request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was 'Negotiate,NTLM'. ---> System.Net.WebException: The remote server returned an error: (401) Unauthorized.
   at System.Net.HttpWebRequest.GetResponse()
   at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)

我们不允许匿名访问或无法从WCF服务中删除Windows身份验证。有没有办法解决这个问题。

客户端的配置是

<basicHttpBinding>
        <binding name="BasicServiceHttpBinding">
          <security mode="TransportCredentialOnly">
            <transport clientCredentialType="Windows" proxyCredentialType="None"
              realm="" />
            <message clientCredentialType="UserName" algorithmSuite="Default" />
          </security>
        </binding>
</basicHttpBinding>

服务器配置

 <basicHttpBinding>
        <binding>
          <security mode="TransportCredentialOnly">
            <transport clientCredentialType="Windows" />
          </security>
        /binding>
  </basicHttpBinding>

0 个答案:

没有答案