WCF窗口集成安全性:从远程客户端计算机访问时获得401

时间:2015-01-28 09:04:08

标签: windows wcf security

我正在尝试使用Windows集成安全性进行WCF服务的简单演示。

已为网站设置了IIS:禁用了匿名身份验证,仅启用了Windows身份验证。

  • 尝试在服务器上本地访问服务,它可以正常工作 http://servername:82/

  • 尝试从其他客户端计算机远程访问服务,
    “无法找到页面”错误出现,并在IIS日志文件中,401
    为请求返回的状态。

  • 如果启用匿名身份验证,远程访问将开始工作。

对此特定问题进行故障排除有什么想法吗?

以下是WCF服务的配置文件。

<?xml version="1.0"?>
<configuration>

  <system.web>
    <compilation debug="true" targetFramework="4.0" />
    <authentication mode="Windows">      
    </authentication>

  </system.web>


<system.serviceModel>

<bindings>
  <basicHttpBinding>
    <binding name="BasicHttpEndpointBinding">
      <security mode="TransportCredentialOnly">
        <transport clientCredentialType="Windows" />
      </security>
    </binding>
  </basicHttpBinding>
</bindings>
<services>
  <service behaviorConfiguration="Service1Behavior" name="WcfServiceDemo.Service1">
    <endpoint address="" binding="basicHttpBinding"
      bindingConfiguration="BasicHttpEndpointBinding"
      name="BasicHttpEndpoint" contract="WcfServiceDemo.IService1">          
    </endpoint>

  </service>
</services>
<behaviors>
  <serviceBehaviors>
    <behavior name="Service1Behavior">
      <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
      <serviceMetadata httpGetEnabled="true"/>
    </behavior>
  </serviceBehaviors>
</behaviors>
 </system.serviceModel>  


</configuration>

0 个答案:

没有答案