【发布时间】:2009-10-28 12:52:21
【问题描述】:
我有一个 Silverlight 应用程序,并添加了一个启用 Silverlight 的 WCF 服务。我想将其部署为使用 Windows 身份验证的 Intranet 解决方案,无需匿名访问。
开箱即用,WCF 服务将以下设置添加到 web.config:
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="WindowsAuthTest.Web.Service1Behavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<customBinding>
<binding name="customBinding0">
<binaryMessageEncoding />
<httpTransport />
</binding>
</customBinding>
</bindings>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
<services>
<service behaviorConfiguration="WindowsAuthTest.Web.Service1Behavior"
name="WindowsAuthTest.Web.Service1">
<endpoint address="" binding="customBinding" bindingConfiguration="customBinding0"
contract="WindowsAuthTest.Web.Service1" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
</system.serviceModel>
将此服务引用添加到 silverlight 项目时,会将这些设置添加到 ServiceReferences.ClientConfig:
<system.serviceModel>
<bindings>
<customBinding>
<binding name="CustomBinding_Service1">
<binaryMessageEncoding />
<httpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="http://localhost:3568/Service1.svc" binding="customBinding"
bindingConfiguration="CustomBinding_Service1" contract="ServiceReference1.Service1"
name="CustomBinding_Service1" />
</client>
</system.serviceModel>
如何修改这些设置以使其能够与 Windows 身份验证一起使用?是否可行?
【问题讨论】:
-
已回答 [此处][1]。 [1]:stackoverflow.com/questions/2845868/…
标签: silverlight authentication silverlight-3.0 windows-authentication