0

我以与此类似的方式设置了自托管 WCF 数据服务 - http://blogs.msdn.com/b/writingdata_services/archive/2011/01/24/self-hosting-a-wcf-data-service。 aspx

如何在此之上添加 Windows 身份验证?

我知道如何在 IIS 中添加它,但是自托管方案正在逃避我......

提前致谢!

4

1 回答 1

0

诀窍是使用 app.config 并在那里配置所有安全设置......:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.serviceModel>
    <bindings>
      <webHttpBinding>
        <binding name="MyBindingName" >
          <security mode="Transport">
            <transport clientCredentialType="Windows" />
          </security>
        </binding>
      </webHttpBinding>
    </bindings>
    <services>
      <service name="{you service type name including the namespace i.e. myapplication.myservice}">
        <endpoint address="" binding="webHttpBinding" bindingConfiguration="MyBindingName" contract="System.Data.Services.IRequestHandler">
        </endpoint>
      </service>
    </services>
  </system.serviceModel>
</configuration>

有关详细答案,请参阅此问题

于 2013-03-15T07:14:35.470 回答