簡體   English   中英

IIS托管的WCF Rest服務保持提示輸入Windows身份驗證憑據

[英]IIS Hosted WCF Rest Service keeeps prompting for Windows Auth Credentials

我正在建立一個WCF休息服務。 該服務位於SSL下的IIS中。 而且我在IIS安裝程序中擁有該站點以使用Windows身份驗證並禁用了匿名身份驗證。

但是,當我嘗試在瀏覽器中導航到service.svc文件以測試Windows身份驗證時,將按預期從我的憑據中得到提示。 但是,輸入我的憑據后,它會不斷提示我一遍又一遍。 而且我不知道為什么或缺少什么。

如果我重新啟用匿名身份驗證並導航到service.svc文件,則將加載wsdl數據。但是據我所知,此時不再使用Windows身份驗證。

我已經在IE和Firefox中對此進行了測試,並且兩者都做同樣的事情。

這是我的web.config

<system.serviceModel>
<bindings>
  <webHttpBinding>
    <binding name="WebHttpBindingConfig">
      <security mode="TransportCredentialOnly">
        <transport clientCredentialType="Windows" proxyCredentialType="Windows"/>
      </security>
    </binding>
  </webHttpBinding>
</bindings>
<behaviors>
  <serviceBehaviors>
    <behavior name="httpEnabled">
      <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
      <serviceCredentials>
        <windowsAuthentication allowAnonymousLogons="False" includeWindowsGroups="True"/>
      </serviceCredentials>
    </behavior>
  </serviceBehaviors>
  <endpointBehaviors>
    <behavior name="EndpBehavior">
      <webHttp helpEnabled="true"/>
    </behavior>
  </endpointBehaviors>
</behaviors>
<services>
  <service name="myService" behaviorConfiguration="httpEnabled">
    <endpoint address="" binding="webHttpBinding" contract="myContract" behaviorConfiguration="EndpBehavior" bindingConfiguration="WebHttpBindingConfig" />
  </service>
</services>

任何幫助弄清楚這一點將是巨大的。 如果您需要其他任何信息,請告訴我。 謝謝。

問題:嘗試在瀏覽器中查看Service.svc時,連續提示輸入憑據。 預期結果:輸入有效憑據后,應加載Service.svc頁面

編輯:我打算發布“身份驗證設置”的圖像以及提供視覺效果的示例,但是我還沒有足夠的聲譽。 抱歉。

我想到了。 最終成為服務器配置問題。 我發現可以使用有效憑據從遠程計算機加載Service.svc文件。 因此,在進行了一些搜索之后,我發現了以下文章:

http://warnajith.blogspot.com/2011/06/iis-75-401-unauthorized-access-error.html

這個問題是我需要DisableLoopbackCheck。 因此,在我按照該頁面上的步驟更新注冊表后,它可以正確加載

注意:如果您使用的是Windows 2012服務器,則無需在提供的鏈接中執行步驟1。

希望這對以后的人有所幫助。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM