Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/silverlight/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
修改启用Silverlight的WCF服务以使用Windows身份验证进行协作_Silverlight_Authentication_Silverlight 3.0_Windows Authentication - Fatal编程技术网

修改启用Silverlight的WCF服务以使用Windows身份验证进行协作

修改启用Silverlight的WCF服务以使用Windows身份验证进行协作,silverlight,authentication,silverlight-3.0,windows-authentication,Silverlight,Authentication,Silverlight 3.0,Windows Authentication,我有一个Silverlight应用程序,并添加了一个支持Silverlight的WCF服务。我想将其部署为一个内部网解决方案,使用Windows身份验证,无需匿名访问 现成的WCF服务将以下设置添加到web.config: <system.serviceModel> <behaviors> <serviceBehaviors> <behavior name="WindowsAuthTest.Web.Service1Behavior"&g

我有一个Silverlight应用程序,并添加了一个支持Silverlight的WCF服务。我想将其部署为一个内部网解决方案,使用Windows身份验证,无需匿名访问

现成的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身份验证一起使用?是否可能?

尝试添加:

安全模式=“仅限TransportCredential”

e、 g


在web.config中,我们使用basicHttpBinding,例如

 <bindings>
      <basicHttpBinding>
        <binding name="customBasicHttpBinding" maxBufferSize="2147483647"
          maxReceivedMessageSize="2147483647">
          <security mode="TransportCredentialOnly">
            <transport clientCredentialType="Windows" proxyCredentialType="None" />
          </security>
        </binding>
      </basicHttpBinding>      
 </bindings>

答案[此处][1]。[1]:
 <bindings>
      <basicHttpBinding>
        <binding name="customBasicHttpBinding" maxBufferSize="2147483647"
          maxReceivedMessageSize="2147483647">
          <security mode="TransportCredentialOnly">
            <transport clientCredentialType="Windows" proxyCredentialType="None" />
          </security>
        </binding>
      </basicHttpBinding>      
 </bindings>