【问题标题】:The server has rejected the client credentials, duplex wcf service服务器已拒绝客户端凭据,双工 wcf 服务
【发布时间】:2012-05-14 07:44:51
【问题描述】:

我在 Windows 服务上托管了一个带有 tcp 绑定的 wcf 服务。它在我们的局域网上正常工作,但是当用户想从互联网连接到服务时,他们会收到以下错误:

服务器拒绝了客户端凭据

这是我的服务配置:

 service behaviorConfiguration="WcfServiceLibrary1.Service1Behavior"
        name="LivePushServiceLib.SubscribeService">
        <endpoint address="" binding="netTcpBinding" bindingConfiguration=""
          contract="WCF_Interface.ISubscribeService">

        </endpoint>
        <endpoint address="mex" binding="mexTcpBinding" bindingConfiguration=""
          contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="net.tcp://188.x.x.x:8524/SubscribeService.svc" />
          </baseAddresses>
        </host>
      </service>
    </services>

【问题讨论】:

    标签: wcf c#-4.0 windows-services networkcredentials


    【解决方案1】:

    您正在使用 Windows 的 NetTcpBinding 的默认安全性。在您的局域网中,我假设每个人都非常高兴地使用 Windows 凭据。但是,来自 Internet 的人不太可能拥有您域的凭据

    如果您想在 Internet 上使用它,请查看将安全设置为 TransportWithMessageCredential 之类的内容,然后使用凭据类型的用户名。这允许基于 Internet 的客户端使用您可以在自定义 UsernamePasswordValidator 中验证的用户名进行身份验证

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-02-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-11-15
      • 2017-10-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多