使用 SAML 安全性令牌为 Web Service 客户机建立安全上下文

WebSphere® Application Server 支持两种策略集调用者绑定配置选项,以使用 Web Service SOAP 请求消息中的 SAML 安全性令牌建立客户机安全上下文。这两个配置选项是将 SAML 令牌映射至本地用户存储库中的用户条目和根据信任关系声明 SAML 令牌。

开始之前

此项任务假设您熟悉 WebSphere Application Server SAML 技术。

关于此任务

此项任务描述了如何设置 WebSphere Application Server 策略集调用者绑定配置选项,以使用 Web Service SOAP 请求消息中的 SAML 安全性令牌建立客户机安全上下文。您可以将 SAML 令牌映射至本地用户存储库中的用户条目,也可以根据信任关系声明 SAML 令牌。第二个配置选项不需要访问本地用户存储库。相反,WS-Security 运行时环境会使用 SAML 安全性令牌的内容来填充整个客户机安全上下文。此过程以 SAML 令牌发布者的信任关系为基础。 如果 SAML 令牌指定 sender-vouches 主体集确认方法,那么该过程以消息发送者的信任关系为基础。

过程

  1. 配置策略集调用者绑定并选择 SAML 令牌类型以表示 Web Service 客户机请求。
    1. 单击 WebSphere 企业应用程序 > application_name > 服务提供程序策略集和绑定 > binding_name > WS-Security > 调用者
    2. 单击新建以创建调用者配置。
    3. 指定名称,例如 caller
    4. 输入调用者标识局部部件的值。例如 http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0,这必须与所连接的 WS-Security 策略中 CustomToken 元素的局部部件相匹配。
    5. 单击应用,然后单击保存
  2. 可选: 将 SAML 安全性令牌映射至本地用户存储库中的用户条目。 在不指定配置选项的情况下配置调用者绑定时,映射至用户条目是缺省行为。(可选)此外,您可以使用以下步骤显式选择此配置选项:
    1. 在调用者绑定配置页面上,添加回调处理程序:com.ibm.websphere.wssecurity.callbackhandler.SAMLIdAssertionCallbackHandler
    2. 添加回调处理程序定制属性 crossDomainIdAssertion,并将它的值设置为 false
  3. 可选: 根据信任关系声明 SAML 安全性令牌。
    1. 在调用者绑定配置页面上,添加回调处理程序:com.ibm.websphere.wssecurity.callbackhandler.SAMLIdAssertionCallbackHandler
    2. 添加回调处理程序定制属性 crossDomainIdAssertion,并将它的值设置为 true
    WebSphere Application Server V7.0 FP7 和更高发行版本中,WS-Security 运行时环境采用 SAML 令牌发布者名称来表示外部安全领域名。WS-Security 采用 NameID 元素(在 SAML 2.0 安全性令牌的情况下)或 NameIdentifier 元素(在 SAML 1.1 安全性令牌的情况下)来表示用户安全性名称。此外,也可以显式指定用于表示用户安全性名称的 SAML 令牌属性。而且,还可以指定用于表示用户组成员资格的 SAML 令牌属性。 有关 SAML 令牌声明信任模型和绑定配置的详细讨论,请参阅关于跨 WebSphere Application Server 安全域的 SAML 声明的内容。

    V8.x 可以传播 SAML 令牌中 com.ibm.websphere.security.cred.WSCredential 的内容。必须使用 Web Service 客户机的 WS-Security 绑定配置中的 issueByWSCredential 属性值来设置 tokenRequest 定制属性。有关此绑定选项的详细描述,请参阅关于传播 SAML 令牌的内容。在 V8.x 中,当 crossDomainIdAssertion 属性设置为 true 时,WS-Security 会检查 SAML 令牌是否包含 SAML 属性 UniqueSecurityName(该属性具有值为 com.ibm.websphere.security.cred.WSCredentialNameFormat 元素)。如果找到该属性,WS-Security 将使用 NameID 元素或 NameIdentifier 元素的 NameQualifier 属性值来表示用户安全领域名。WS-Security 还使用 UniqueSecurityName 属性值和 GroupIds 属性值来表示唯一用户名和组成员资格。V7 与 V8.x 产品之间的此缺省行为有所不同。您可以添加 CallbackHandler 属性 IssuerNameForRealm,并将它的值设置为 true 以将 V8.x 配置成保留 V7 行为。或者,可以添加 CallbackHandler 属性 NameQualifierForRealm,并将它的值设置为 true 以将 V8.x 配置成始终使用 NameQualifier 属性来表示用户安全领域名。

  4. 启用和配置 WebSphere Application Server 全局安全性。

    您可使用“安全配置”向导来启用管理安全性。您还需要启用应用程序安全性,以便样本应用程序可使用安全上下文中已认证的用户主体集来创建 SAML 令牌。此步骤涉及在 Web Service 提供程序端配置第三个信任关系验证点。必须完成此步骤才能使用应用程序服务器来模拟目标安全域 Web Service 提供程序。WebSphere Application Server V8.0 认证子系统支持断言具有外部领域名称的用户标识,并且将根据入站可信认证领域列表来检查该外部领域名称。完成此配置步骤之后,WebSphere Application Server 便可以创建在外部安全领域中具有用户标识的客户机调用者主体集。

  5. 配置可信安全域。
    1. 在“全局安全性”面板中,单击可用的领域定义旁边的配置按钮。
    2. 单击可信认证领域 - 入站链接。
    3. 选择信任如下所示的领域选项。
    4. 单击添加外部领域按钮。
    5. 将 SAML 断言签发者名称添加到外部领域名称

      SAML 断言签发者名称提供有关 SAML 断言签发者的信息,该元素或者在 SAML 2.0 断言中的 Issuer 元素内,或者是 SAML 断言中的“签发者”属性。

结果

现在,您已配置了 Web Service 以使用 Web Service SOAP 请求消息中的 SAML 安全性令牌来建立客户机安全上下文。

示例

以下示例阐明了基于 WSCredential 的自签发 SAML 1.1 声明中的 NameIdentifierAttribute 元素:
<saml:AttributeStatement>
    <saml:Subject>
        <saml:NameIdentifier NameQualifier="ldap.example.com:9080">uid=alice,dc=example,dc=com</saml:NameIdentifier>
        <saml:SubjectConfirmation>
            <saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:bearer</saml:ConfirmationMethod>
        </saml:SubjectConfirmation>
    </saml:Subject>
    <saml:Attribute AttributeName="UniqueSecurityName" AttributeNamespace="com.ibm.websphere.security.cred.WSCredential">
        <saml:AttributeValue>uid=alice,dc=example,dc=com</saml:AttributeValue>
    </saml:Attribute>
    <saml:Attribute AttributeName="GroupIds" AttributeNamespace="com.ibm.websphere.security.cred.WSCredential">
        <saml:AttributeValue>cn=development,dc=example,dc=com</saml:AttributeValue>
        <saml:AttributeValue>cn=deployment,dc=example,dc=com</saml:AttributeValue>
        <saml:AttributeValue>cn=test,dc=example,dc=com</saml:AttributeValue>
    </saml:Attribute>
</saml:AttributeStatement>
以下示例阐明了基于 WSCredential 的自签发 SAML 2.0 声明中的 NameIDAttribute 元素:
<saml2:AttributeStatement>
    <saml2:Attribute Name="UniqueSecurityName" NameFormat="com.ibm.websphere.security.cred.WSCredential" />
    <saml2:AttributeValue>uid=alice,dc=example,dc=com</saml2:AttributeValue>
    <saml2:Attribute>
        <saml2:Attribute AttributeName="GroupIds" NameFormat="com.ibm.websphere.security.cred.WSCredential" />
        <saml2:AttributeValue>cn=development,dc=example,dc=com</saml2:AttributeValue>
        <saml2:AttributeValue>cn=deployment,dc=example,dc=com</saml2:AttributeValue>
        <saml2:AttributeValue>cn=test,dc=example,dc=com</saml2:AttributeValue>
    </saml2:Attribute>
<saml2:AttributeStatement>

<saml2:NameID NameQualifier="ldap.example.com:9060">alice</saml2:NameID>

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



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