繁体   English   中英

重现问题:客户端身份验证方案“匿名”禁止使用http请求

[英]Reproduce Issue: The http request was forbidden with client authentication scheme 'anonymous'

我想重现wcf问题: 客户端身份验证方案“匿名”禁止使用HTTP请求

我们正在产品中使用wcf服务,并且已将wcf服务托管为Windows服务( 自助服务 ),并且该wcf服务已由小型Windows客户端应用程序使用

在我们的环境中一切正常。 但是,我们的一位客户报告说,他们从远程客户端计算机连接客户端应用程序时收到错误“ 客户端身份验证方案'匿名'禁止http请求 ”。

在这里,我的问题是,任何人都可以帮助我在我们的环境中重新产生此问题,以便我们提供完美的解决方案。

ServiceApp.config

<bindings>
      <wsHttpBinding>
        <binding name="MyBinding" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
          <readerQuotas maxDepth="100" maxStringContentLength="2147483647"
            maxArrayLength="2147483647" maxBytesPerRead="2147483647" />
          <reliableSession inactivityTimeout="24.00:00:00" />
          <security mode="None">
            <message clientCredentialType="None" />
          </security>

        </binding>
      </wsHttpBinding>
    </bindings>
    <services>
      <service behaviorConfiguration="MyBehaviour" name="WcfServer.CalculatorService">
        <endpoint address="http://localhost:7000/Test" behaviorConfiguration="MyEndPointBehavior"
          binding="wsHttpBinding"  bindingConfiguration="MyBinding"
          name="EndPt_Service" contract="WcfServer.ICalculator"/>
      </service>
    </services>

clientapp.config

<bindings>
      <wsHttpBinding>
        <binding name="CalBinding" maxBufferPoolSize="2147483647"  maxReceivedMessageSize="2147483647">
          <readerQuotas maxDepth="100" maxStringContentLength="2147483647"
            maxArrayLength="2147483647" maxBytesPerRead="2147483647" />
          <reliableSession inactivityTimeout="24.00:00:00" />
          <security mode="None">
            <message clientCredentialType="None" />
          </security>
        </binding>
      </wsHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://RemoteServerName:7000/Test" behaviorConfiguration="CalEndPointBehavior"
        binding="wsHttpBinding" contract="WcfServer.ICalculator"
         name="EndPt_Calc" bindingConfiguration="CalBinding"/>
    </client>

我在msdn论坛中找到了这个,希望对您有所帮助:

由于为WsHttpBinding指定了安全模式=无,因此当它向WCF服务发出请求时,服务将尝试使用Aninymous凭据对客户端进行身份验证,但是在不同域的情况下,此操作将无效,因此请尝试使用X509证书。

因此,请尝试在两个不同的域之间建立连接。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM