<clientCredentials>

指定用于向服务验证客户端身份的凭据。Specifies the credentials used to authenticate the client to a service.

<configuration>
  <system.serviceModel>
    <behaviors>
      <endpointBehaviors>
        <behavior>
          <clientCredentials>

语法Syntax

<clientCredentials type="String"
                   supportInteractive="Boolean" >
  <clientCertificate>
  </clientCertificate>
  <digest>
  </digest>
  <isuedToken>
  </isuedToken>
  <peer>
  </peer>
  <serviceCertificate>
  </serviceCertificate>
  <windowsAuthentication>
  </windowsAuthentication>
</clientCredentials>

特性和元素Attributes and Elements

下列各节描述了特性、子元素和父元素。The following sections describe attributes, child elements, and parent elements.

特性Attributes

属性Attribute 说明Description
supportInteractive 一个布尔值,指定在运行时选择客户端凭据的过程中是否可以涉及交互式用户。A Boolean value that specifies whether an interactive user can be involved in selecting a client credential at runtime. 默认值为 trueThe default value is true.
type 一个指定此配置元素的类型的字符串。A string that specifies the type of this configuration element.

子元素Child Elements

元素Element 描述Description
<clientCertificate> 指定用于向服务验证客户端身份的证书。Specifies the certificate used to authenticate the client to the service. 此元素的类型为 X509InitiatorCertificateClientElementThis element is of type X509InitiatorCertificateClientElement.
<httpDigest> 指定用于向服务验证客户端身份的摘要。Specifies a digest used to authenticate the client to the service. 此元素的类型为 HttpDigestClientElementThis element is of type HttpDigestClientElement.
<issuedToken> 指定用于向安全令牌服务 (STS) 验证客户端身份的自定义令牌类型。Specifies a custom token type used to authenticate the client to a Secure Token Service (STS). 此元素的类型为 IssuedTokenClientElementThis element is of type IssuedTokenClientElement.
<peer> 指定一个当前对等凭据。Specifies a current peer credential. 此元素的类型为 PeerCredentialElementThis element is of type PeerCredentialElement.
<serviceCertificate> 指定用于向客户端验证服务身份的证书,并提供一个用于设置证书选项的结构。Specifies the certificate used to authenticate the service to the client and provides a structure for setting certificate options. 必须从服务以带外方式向客户端提供此证书。This certificate must be supplied out-of-band from the service to the client. 此元素的类型为 X509RecipientCertificateClientElementThis element is of type X509RecipientCertificateClientElement.
<windows> 指定 Windows 凭据。Specifies a Windows credential. 默认值是当前线程的凭据。The default is the credential of the current thread. 此元素的类型为 WindowsClientElementThis element is of type WindowsClientElement.

父元素Parent Elements

元素Element 描述Description
<behavior> 指定终结点行为。Specifies an endpoint behavior.

注解Remarks

在要求相互进行身份验证的情况下,需要使用客户端凭据使客户端通过服务的身份验证。Client credentials are used to authenticate the client to services in cases where mutual authentication is required. 当客户端必须使用服务的证书来保护发送到服务的消息时,还可以使用该配置节来指定服务证书。This configuration section can also be used to specify service certificates for scenarios where the client must secure messages to a service with the service's certificate.

另请参阅See also