配置策略集和绑定以便与 STS 通信

配置策略集和绑定文档以允许 Web Service 客户机从外部安全性令牌服务 (STS) 请求 SAML 声明。

开始之前

安装之后,必须创建新的服务器概要文件或者将 SAML 配置设置添加到现有概要文件。有关更多信息,请参阅关于设置 SAML 配置的内容。

关于此任务

具有 SAML 的 WebSphere® Application Server 在与外部安全性令牌服务 (STS) 通信时,支持使用 Web Service 安全策略集和绑定的 Web Service 客户机。Web Service 客户机使用策略集和绑定来与目标 Web Service 提供程序通信。Web Service 客户机使用两组策略集连接:其中一组策略集连接用来与目标 Web Service 提供程序通信;另一组策略集连接用来与 STS 通信。与目标 Web Service 提供程序通信时所使用的策略集和绑定将连接到 Web Service 客户机。与此相反,用于启用 STS 通信的策略集和绑定将不直接连接到 Web Service 客户机。而是将用于启用 STS 通信的策略集和绑定指定为 Web Service 客户机绑定文档中的定制属性。您可以使用常规绑定或特定于应用程序的绑定来与 STS 通信。使用常规绑定来访问 STS 比较简单;只需在定制属性中指定常规绑定名称。

配置特定于应用程序的绑定以访问 STS 的过程更加复杂。管理控制台设计用来管理策略集连接以与 Web Service 提供程序通信。 该控制台未设计用来管理第二组策略集连接以与 STS 通信。但是,您可以使用管理控制台来管理策略集连接以访问 STS,如过程中所述。

使用管理控制台将用于访问 STS 的策略集连接到 Web Service 客户机,然后创建并修改特定于应用程序的绑定。完成绑定配置之后,将策略集和绑定与 Web Service 客户机拆离。因为下一步是要连接策略集和绑定以与目标 Web Service 提供程序通信,所以此过程是必需过程。已拆离的特定于应用程序的绑定不会从文件系统中删除,所以 Web Service 客户机绑定定制属性可以成功地引用已拆离的特定于应用程序的绑定。

该过程使用缺省应用程序策略集 Username WSHTTPS default 作为示例,以描述用于访问 STS 的配置步骤。这些步骤也适用于其他策略集。在该示例中,使用了 Web Service 应用程序 JaxWSServicesSamples。缺省情况下,未安装 JaxWSServicesSamples。

过程

  1. 导入 Username WSHTTPS default 策略集。 在此示例中,Username WSHTTPS default 策略用于说明过程,但您可以使用不同的策略集来配置绑定(如果该策略集满足外部 STS 的策略需求的话)。
    1. 单击服务 > 策略集 > 应用程序策略集
    2. 单击导入
    3. 选择从缺省存储库
    4. 选择 WSHTTPS default 策略集。
    5. 单击确定以导入该策略集。
  2. 为信任客户机连接策略集。单击应用程序 > 应用程序类型 > WebSphere 企业应用程序 > JaxWSServicesSamples > 服务客户机策略集和绑定 仅当使用特定于应用程序的绑定来访问外部 STS 时,才需要关于连接和分离策略集以及配置信任客户机绑定的步骤。如果您使用常规绑定来访问外部 STS,那么可以跳过这些步骤,并转至讨论配置与 STS 的通信的步骤。
    1. 选中 Web service 客户机资源的复选框。
    2. 单击连接客户机策略集
    3. 选择策略集 Username WSHTTPS default
    此步骤将策略集连接至 Web service 信任客户机,正如您要将此策略集用于应用程序客户机以访问目标 Web service 时将执行的操作一样。但是,由于您计划改为使用 Username WSHTTPS default 策略集来访问外部 STS,因此该策略集仅暂时连接到 Web service 客户机。此步骤的目的是允许您使用管理控制台创建或修改客户机绑定文档。
  3. 配置信任客户机绑定。
    1. 再次选择 Web service 客户机资源。
    2. 在“服务客户机策略集和绑定”面板中,单击分配绑定
    3. 单击新建特定于应用程序的绑定以创建特定于应用程序的绑定。
    4. 为新建的特定于应用程序的绑定指定绑定配置名称。在此示例中,绑定名称为 SamlTCSample
    5. SSL 传输策略类型添加到绑定。 (可选)修改 NodeDefaultSSLSettings 设置。单击安全性 > SSL 证书和密钥管理 > SSL 配置 > NodeDefaultSSLSettings
  4. 可选: 如果要配置用户名和密码以添加到 HTTP 头,或者如果要配置代理,那么您可以使用上述步骤来创建 HTTP 传输绑定。如果选择不创建 HTTP 传输绑定,那么 Web Service 运行时环境将使用缺省 HTTP 传输设置。
  5. WS-Security 策略类型添加到绑定,然后修改认证设置。
    1. 单击应用程序 > 应用程序类型 > WebSphere 企业应用程序 > JaxWSServicesSamples > 服务客户机策略集和绑定 > SamlTCSample > 添加 > WS-Security > 认证和保护 > request:uname_token
    2. 单击应用
    3. 选择回调处理程序
    4. 指定用户名和密码(并确认该密码)以使 Web service 客户机向外部 STS 进行认证。
    5. 单击确定保存
  6. 保存绑定设置后,返回到“服务客户机策略集和绑定”面板以分离策略集和绑定。
    1. 单击应用程序 > 应用程序类型 > WebSphere 企业应用程序 > JaxWSServicesSamples > 服务客户机策略集和绑定
    2. 单击 Web service 客户机资源的复选框。
    3. 单击分离客户机策略集
    分离策略集时,不会从文件系统中删除您在先前步骤中创建的特定于应用程序的绑定配置。这表示您仍然可以使用您创建的特定于应用程序的绑定来访问 STS。
  7. 从外部 STS 导入 SSL 证书。
    1. 单击安全性 > SSL 证书和密钥管理 > 管理端点安全性配置 > server_or_node_endpoint > 密钥库和证书 > NodeDefaultTrustStore > 签署者证书
    2. 单击从端口检索
    3. 指定外部 STS 服务器的主机名和端口号,并为证书分配别名。 使用 SSL STS 端口。
    4. 单击检索签署者信息
    5. 单击应用保存以将检索到的证书复制到 NodeDefaultTrustStore 对象。
  8. 可选: 如果需要对 wstrustClientBinding 配置进行进一步修改,并且 wstrustClientBinding 属性指向特定于应用程序的绑定,那么必须将该特定于应用程序的绑定连接到 Web Service 客户机,然后才能完成这些修改。连接是暂时的。如先前步骤中所详细叙述,当修改完成后,您可以将已修改的特定于应用程序的绑定与 Web Service 客户机分离。

结果

成功完成这些步骤之后,Web Service 客户机就可以向外部 STS 发送请求。为了启用此功能,已在完成该过程时激活了以下条件和设置:
  • 连接用于传播 SAML 令牌的策略集和绑定。例如,将 SAML11 Bearer WSHTTPS default 策略集和“Saml Bearer 客户机样本”常规绑定连接到 Web Service 客户机。
  • Username WSHTTPS default 策略集和特定于应用程序的绑定 SamlTCSample 已在“Saml Bearer 客户机样本”绑定中进行引用,并且已设置成访问外部 STS。
  • 已检索外部 STS SSL 证书并将该证书添加到 NodeDefaultTrustStore 信任库。
  • 要确认已成功启用该功能,您可以配置跟踪设置 com.ibm.ws.wssecurity.*=all=enabled。 跟踪将显示由外部 STS 发布的 SAML 声明,例如:
    [8/23/09 18:26:59:252 CDT] 0000001f TrustSecurity 3   Security Token Service response:
    [8/23/09 18:26:59:392 CDT] 0000001f TrustSecurity 3   
    <?xml version="1.0" encoding="UTF-8"?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" 
       xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
        <s:Header>
            <a:Action s:mustUnderstand="1">http://docs.oasis-open.org/ws-sx/ws-trust/200512/RSTRC/IssueFinal</a:Action>
            <a:RelatesTo>urn:uuid:663A7B27BA8EB2CF9D1251070029934</a:RelatesTo>
            <o:Security xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" s:mustUnderstand="1">
                <u:Timestamp u:Id="_0">
                    <u:Created>2009-08-23T23:26:57.664Z</u:Created>
                    <u:Expires>2009-08-23T23:31:57.664Z</u:Expires>
                </u:Timestamp>
            </o:Security>
        </s:Header>
        <s:Body>
          <trust:RequestSecurityTokenResponseCollection xmlns:trust="http://docs.oasis-open.org/ws-sx/ws-trust/200512">
            <trust:RequestSecurityTokenResponse>
              <trust:Lifetime>
                <wsu:Created 
    xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2009-08-23T23:26:57.648Z</wsu:Created>
                <wsu:Expires 
    xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2009-08-24T09:26:57.648Z</wsu:Expires>
              </trust:Lifetime>
            <wsp:AppliesTo xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
              <a:EndpointReference>
                 <a:Address>https://taishan.austin.ibm.com:9443/WSSampleSei/EchoService12</a:Address>
                  </a:EndpointReference>
            </wsp:AppliesTo>
            <trust:RequestedSecurityToken>
              <saml:Assertion xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" MajorVersion="1" MinorVersion="1" 
    AssertionID="_3c656382-9916-4e5f-9a16-fe0287dfc409" Issuer="http://svt193.svt193domain.com/Trust" IssueInstant="2009-08-23T23:26:57.663Z">
              <saml:Conditions NotBefore="2009-08-23T23:26:57.648Z" NotOnOrAfter="2009-08-24T09:26:57.648Z">
              <saml:AudienceRestrictionCondition>
              <saml:Audience>https://taishan.austin.ibm.com:9443/WSSampleSei/EchoService12</saml:Audience>
              </saml:AudienceRestrictionCondition>
              </saml:Conditions>
              <saml:AuthenticationStatement AuthenticationMethod="urn:oasis:names:tc:SAML:1.0:am:password" 
    AuthenticationInstant="2009-08-23T23:26:57.640Z">
              <saml:Subject>
              <saml:SubjectConfirmation>
              <saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:bearer</saml:ConfirmationMethod>
              </saml:SubjectConfirmation>
              </saml:Subject>
              </saml:AuthenticationStatement>
                <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
                <ds:SignedInfo>
                <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
                <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
                <ds:Reference URI="#_3c656382-9916-4e5f-9a16-fe0287dfc409">
                <ds:Transforms>
                <ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
                <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
                </ds:Transforms>
                <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
                <ds:DigestValue>YGySZX4VPv25R+oyzFpE0/T/tjs=</ds:DigestValue>
                </ds:Reference>
                </ds:SignedInfo>
                     <ds:SignatureValue>eP68...Vr08=</ds:SignatureValue>
                       <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
                          <X509Data>
                            <X509Certificate>MII...ymqg3</X509Certificate>
                          </X509Data>
                        </KeyInfo>
                      </ds:Signature>
                 </saml:Assertion>
             </trust:RequestedSecurityToken>
           <trust:RequestedAttachedReference>
              <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
                <o:KeyIdentifier 
    ValueType="http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.0#SAMLAssertionID">_3c656382-9916-4e5f-9a16-fe0287dfc409</o:KeyIdentifier>
                </o:SecurityTokenReference>
            </trust:RequestedAttachedReference>
            <trust:RequestedUnattachedReference>
              <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
                 <o:KeyIdentifier 
    ValueType="http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.0#SAMLAssertionID">_3c656382-9916-4e5f-9a16-fe0287dfc409</o:KeyIdentifier>
              </o:SecurityTokenReference>
            </trust:RequestedUnattachedReference>
            <trust:TokenType>http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1</trust:TokenType>
            <trust:RequestType>http://docs.oasis-open.org/ws-sx/ws-trust/200512/Issue</trust:RequestType>
            <trust:KeyType>http://docs.oasis-open.org/ws-sx/ws-trust/200512/Bearer</trust:KeyType>
            </trust:RequestSecurityTokenResponse>
            </trust:RequestSecurityTokenResponseCollection>
        </s:Body>
    </s:Envelope>

下一步做什么

完成 Web Service 客户机和 Web Service 提供程序配置。有关更多信息,请参阅关于为 SAML 不记名令牌配置客户机和提供程序绑定的内容。

指示主题类型的图标 任务主题



时间戳记图标 最近一次更新时间: last_date
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=twbs_configsamlpsbindsts
文件名:twbs_configsamlpsbindsts.html