【问题标题】:Self-hosted WCF Data service authentication自托管 WCF 数据服务身份验证
【发布时间】:2013-03-14 13:39:55
【问题描述】:

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

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

我知道如何在 IIS 中添加它,但是自托管场景让我无法理解...

提前致谢!

【问题讨论】:

    标签: .net wcf wcf-data-services self-hosting


    【解决方案1】:

    诀窍是使用 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>
    

    详细答案请见this question

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-01-13
      • 2011-07-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多