繁体   English   中英

WCF说我的设置需要“匿名”身份验证-但我不希望它们

[英]WCF Says my settings require 'Anonymous' authentication - but I don't want them

因此, 这个问题与我的问题完全相同。

此服务的安全设置需要“匿名”身份验证,但是承载此服务的IIS应用程序未启用该身份验证。

但是,我已经从Web配置中删除了mex端点,但仍然出现相同的错误。 我的网络配置如下所示:

<system.serviceModel>
<services>
  <service name="xxx.MessageHub.MessageHubService"
           behaviorConfiguration="default">
    <endpoint binding="wsHttpBinding"
              contract="xxx.MessageHub.IMessageHubService" />
  </service>
</services>
    <behaviors>
  <endpointBehaviors>
  </endpointBehaviors>
        <serviceBehaviors>
            <behavior name="default">
                <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
                <serviceMetadata httpGetEnabled="true"/>
                <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
                <serviceDebug includeExceptionDetailInFaults="true"/>
      <serviceAuthorization principalPermissionMode="UseWindowsGroups" />
            </behavior>

        </serviceBehaviors>
    </behaviors>
    <bindings>
        <basicHttpBinding>
            <binding name="credsOnly">
                <security mode="TransportCredentialOnly">
                    <transport clientCredentialType="Windows"></transport>
                </security>
            </binding>
        </basicHttpBinding>
        <wsHttpBinding>
            <binding name="transport">
                <security mode="Transport">
                    <transport clientCredentialType="Windows"></transport>
                </security>
            </binding>
        </wsHttpBinding>
    </bindings>
</system.serviceModel>

我正在运行具有IIS6兼容性并添加到IIS7的应用程序(因为我们的产品服务器运行IIS6-部署到测试服务器时会遇到相同的异常)。

我需要修复哪些设置才能使此功能正常工作?

我可以按照在此msdn帖子中找到的步骤(略有修改)来解决此问题:

  1. 右键单击WCF服务的Web.config文件,然后单击“ 编辑WCF配置”
  2. 在配置编辑器的“配置”部分中,选择“ 绑定”文件夹。
  3. 在“绑定”部分中,选择“ 新建绑定配置”
  4. 在“创建新绑定”对话框中,选择“ wsHttpBinding” 单击确定。
  5. 将绑定配置的名称设置为一些逻辑且可识别的名称; 例如, WsHttpEndpointBinding
  6. 单击安全选项卡。
  7. 通过从下拉菜单中选择此选项,将模式属性设置为传输
  8. 通过从下拉列表中选择此选项,将TransportClientCredentialType设置为Ntlm

  9. 在“ 配置”部分中,选择WsHttpEndpoint
  10. 通过从下拉列表中选择此选项,将BindingConfiguration属性设置为WsHttpEndpointBinding 这会将绑定配置设置与绑定相关联。

  11. 在配置编辑器的“文件”菜单上,单击“保存”。

并且(据我所知)这提供了使用集成身份验证(而不是Windows集成)的身份验证。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM