<serviceCredentials> 的 <windowsAuthentication>

指定 Windows 服务凭据的设置。

<system.serviceModel>
  <behaviors>
    <serviceBehaviors>
      <serviceBehaviors> 的 <behavior>
        <serviceCredentials>
          <serviceCredentials> 的 <windowsAuthentication>

<windowsAuthentication
      allowAnonymousLogons="Boolean"
      includeWindowsGroups="Boolean" />

属性和元素

属性

属性 说明

includeWindowsGroups

一个可选的布尔值属性,指定系统是否将 Windows 组包含在安全上下文中。默认值为 true

将此属性设置为 true 会影响性能,因为这会导致完全组扩展。如果不需要建立用户所属组的列表,请将此属性设置为 false

allowAnonymousLogons

一个可选的布尔值属性,指定是否允许匿名的未经过身份验证的调用方。默认值为 false

如果将绑定的 clientCredentialType 属性设置为 Windows,则系统不允许匿名的调用方。这意味着,只有经过身份验证的域或工作组调用方才可以访问系统。可以使用此属性重写此行为。

使用此设置应特别小心。

子元素

无。

父元素

元素 说明

<serviceCredentials>

指定要用于对服务进行身份验证的凭据以及与客户端凭据验证相关的设置。

备注

通过设置 allowAnonymousLogons 属性,使用此元素可指定是否允许匿名 Windows 用户访问。此外,通过设置 includeWindowsGroups 属性还可以指定是否在 AuthorizationContext 中包含用户所属的组信息。如果将它设置为 true(默认设置),服务就可以确定客户端所属的 Windows 组。

另请参见

参考

WindowsServiceElement
WindowsAuthentication
WindowsAuthentication
WindowsServiceCredential