【问题标题】:WCF security errorsWCF 安全错误
【发布时间】:2009-12-10 03:59:27
【问题描述】:

我最近对一个包含 wcf 服务的工作 Web 应用程序进行了更改。发布内容后,我收到错误此服务的安全设置需要“匿名”身份验证,但托管此服务的 IIS 应用程序未启用它..

在过去的五个小时里,我一直在网上搜索,试图对此有所了解

我有未经检查的匿名授权...

这是我的 web.config 中的网络服务部分,请帮忙!!!

<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_IService1" >

  <security mode="TransportWithMessageCredential">
    <transport clientCredentialType="Windows"/>
  </security>

</binding>
</wsHttpBinding>



</bindings>
<client>
<!--http://localhost:2083/Service1.svc-->
 <endpoint address="" binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_IService1" contract="ServiceReference1.IService1"
 name="WSHttpBinding_IService1">
 <identity>
 <dns value="issupport03" />
 </identity>
 </endpoint>
</client>
 <services>
 <service name="WcfService1.AjaxWcf">
 <endpoint address="" behaviorConfiguration="WcfService1.AjaxWcfAspNetAjaxBehavior"
 binding="webHttpBinding" contract="WcfService1.AjaxWcf" />
 </service>
 </services>
    <behaviors>
<endpointBehaviors>
<behavior name="WcfService1.AjaxWcfAspNetAjaxBehavior">
 <enableWebScript />
</behavior>
 </endpointBehaviors>
<serviceBehaviors>
 <behavior name="WcfService1.AjaxWcfAspNetAjaxBehavior">
   <serviceDebug includeExceptionDetailInFaults="True"/>
 </behavior>
</serviceBehaviors>
</behaviors>

【问题讨论】:

  • 请编辑您的标题;你的标题非常非常烦人
  • 如果您认为标题令人讨厌,我深表歉意;告诉我,你觉得应该是什么?
  • 我冒昧地更改了它。您不应该在标题中添加与“紧急”或“请帮助”等问题不直接相关的任何内容。此外,感叹号会让人分心。

标签: wcf wcf-binding


【解决方案1】:

检查运行您的应用程序池的身份。此用户可能无权访问它可能正在使用的任何资源。

【讨论】:

    【解决方案2】:

    我建议您备份当前代码,然后从源代码控制恢复到以前的版本。构建并部署该版本,然后确保它可以在生产环境中运行。

    如果可行,则将生产版本与备份版本进行比较。看看有什么变化。一点一点地改回来,直到它再次起作用。

    【讨论】:

    • 我认为这是让我在我造成的混乱中更深的部分原因......在尝试修复它大约一个小时后,我在当前版本的顶部发布了一个旧版本。它没有解决问题,但是一旦我做了所有旧的“更改”,就会导致它恢复到以前的问题,基本上是降级应用程序......不过,谢谢!
    【解决方案3】:

    基本上我修复它的方法是从 wsHttpBinding 更改为 webHttpBinding:

    <security mode="TransportCredential">
     <transport clientCredentialType="Windows"/>
    </security>
    

    它现在可以工作了,而且由于它在 Intranet 上,所以我现在并不担心安全问题......但是,我真的希望我知道它为什么坏了以及我应该做些什么来修复它......

    感谢所有帮助过的人!!!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-02-07
      • 2010-11-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-12-01
      相关资源
      最近更新 更多