【问题标题】:Silverlight and WCF with Windows AuthenticationSilverlight 和 WCF 与 Windows 身份验证
【发布时间】:2011-02-21 17:42:49
【问题描述】:

我在 ASP.NET Web 应用程序中有一个 Silverlight 应用程序。然后,我在 ASP.NET 应用程序中托管了一个 WCF 服务库。我已将安全性设置为 TransportWithCredentialOnly 和 Windows 身份验证。这是一个 Intranet 场景。

在测试服务器上的 IIS7 中,我禁用了匿名身份验证并启用了 Windows 身份验证。使用此设置,WCF 调用将失败。

如果我启用匿名身份验证,那么它可以工作。如果无法禁用匿名身份验证,Windows 身份验证的意义何在。

当我在 IE 中使用 Web Helper 时,似乎有一个对服务的调用,类似于您获取服务定义时的调用,这需要匿名身份验证。然后我假设对 Service 方法的实际调用仍将被正确验证。

由于我很困惑,任何人都可以对此有所了解。几个月后我们将有渗透测试人员,我担心他们会不喜欢他们可以在 Fiddler 或类似工具中看到服务调用的想法,然后他们可以将其复制并粘贴到地址栏中以获取服务定义。在他们非常特别之前与他们合作过,他们可以从应用程序中获得的任何信息都是减分。在我的特定行业中,安全性非常重要。

如果我做错了,任何帮助将不胜感激。

【问题讨论】:

    标签: windows silverlight wcf authentication


    【解决方案1】:

    我已经为同样的问题苦苦挣扎。我通过修改我的 web.config 文件解决了我的问题。这是我下面的内容。

    希望对你有帮助!

    祝你好运。

    <system.serviceModel>
        <bindings>
          <customBinding>
            <binding name="MyAp.Web.Services.MyAppSvc.customBinding0">
              <binaryMessageEncoding>
                <readerQuotas maxStringContentLength="2147483647" maxArrayLength="2147483647" />
              </binaryMessageEncoding>
              <httpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" authenticationScheme="Ntlm" unsafeConnectionNtlmAuthentication="true" />
            </binding>
          </customBinding>
        </bindings>
        <services>
          <service name="MyApp.Web.Services.MyAppSvc">
            <endpoint address="" binding="customBinding" bindingConfiguration="MyApp.Web.Services.MyAppSvc.customBinding0" contract="MyApp.Web.Services.MyAppSvc" />
            <!--<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>-->
          </service>
        </services>
        <behaviors>
          <serviceBehaviors>
            <behavior name="">
              <serviceMetadata httpGetEnabled="true" />
              <serviceDebug includeExceptionDetailInFaults="false" />
              <dataContractSerializer maxItemsInObjectGraph="2147483647" />
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
      </system.serviceModel>
    

    【讨论】:

    • 感谢您的回复。我尝试将我的所有设置(当然服务特定名称除外)更改为与您的相同,但我仍然无法禁用匿名功能。谢谢你的建议。谢谢。
    • 再次在您的 web.config 中。你有 标签吗?
    • 是 - 在 Silverlight 主机站点和 WCF 服务站点中。
    • 上面的代码 sn-p 似乎没有显示任何身份验证配置...我不明白。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-12-02
    • 2011-07-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多