簡體   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