<knownCertificates>

表示所提供的 X.509 证书的集合,这些证书用于对安全令牌服务 (STS) 颁发的安全凭据进行身份验证。

<system.serviceModel>
  <behaviors>
    <serviceBehaviors>
      <serviceBehaviors> 的 <behavior>
        <serviceCredentials>
          <serviceCredentials> 的 <issuedTokenAuthentication>
            <knownCertificates>

<knownCertificates> 
      <add findValue="String"
         storeLocation="CurrentUser/LocalMachine"
          storeName=" CurrentUser/LocalMachine"
           x509FindType="FindByThumbprint/FindBySubjectName/FindBySubjectDistinguishedName/FindByIssuerName/FindByIssuerDistinguishedName/FindBySerialNumber/FindByTimeValid/FindByTimeNotYetValid/FindBySerialNumber/FindByTimeExpired/FindByTemplateName/FindByApplicationPolicy/FindByCertificatePolicy/FindByExtension/FindByKeyUsage/FindBySubjectKeyIdentifier"/>
</knownCertificates>

属性和元素

属性

无。

子元素

元素 说明

<knownCertificates> 的 <add>

将一个 X.509 证书添加到集合中。

父元素

元素 说明

<serviceCredentials> 的 <issuedTokenAuthentication>

将颁发的令牌指定为服务凭据。

备注

颁发的令牌方案包含三个阶段。在第一个阶段中,尝试访问服务的客户端被指引到安全令牌服务**。然后,安全令牌服务对该客户端进行身份验证,随后向该客户端颁发一个令牌(通常是一个安全断言标记语言 (SAML) 令牌)。接下来,客户端携带此令牌返回服务。服务检查该令牌,以获取使其可以对该令牌并进而对该客户端进行身份验证的数据。若要对令牌进行身份验证,安全令牌服务所使用的证书必须为该服务所知。

<serviceCredentials> 的 <issuedTokenAuthentication> 元素是所有此类安全令牌服务证书的储存库。若要添加证书,请使用 <knownCertificates>。请为每个证书插入一个 <knownCertificates> 的 <add>,如下面的示例所示。

<issuedTokenAuthentication>
   <knownCertificates>
      <add findValue="www.contoso.com" 
           storeLocation="LocalMachine" storeName="My" 
           X509FindType="FindBySubjectName" />
    </knownCertificates>
</issuedTokenAuthentication>

默认情况下,必须从安全令牌服务那里获取证书。这些“已知的”证书可以确保只有合法的客户端才能访问服务。

若要查看客户端可以由联合服务进行身份验证所需满足的条件,以及有关使用此配置元素的更多信息,请参见How to: Configure Credentials on a Federation Service。有关联合方案的更多信息,请参见Federation and SAML

有关演示如何填充配置中的集合的示例,请参见 <knownCertificates> 的 <add>

另请参见

参考

<knownCertificates> 的 <add>
<serviceCredentials> 的 <issuedTokenAuthentication>
<knownCertificates> 的 <add>
SamlSecurityTokenAuthenticator
AllowedAudienceUris
AudienceUriMode
KnownCertificates
X509CertificateTrustedIssuerElementCollection
X509CertificateTrustedIssuerElement
KnownCertificates

其他资源

Security Behaviors in Windows Communication Foundation
How to: Configure Credentials on a Federation Service
Working with Certificates
Federation and SAML
Securing Services and Clients