【问题标题】:Self-hosted WCF Data service authentication自托管 WCF 数据服务身份验证
【发布时间】:2013-03-14 13:39:55
【问题描述】:
【问题讨论】:
标签:
.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。