SAML 企业版身份提供商

本主题介绍了配置 SAML Enterprise身份提供商所需的 SAML 元数据和用户属性映射信息。

SAML 是一种XML标准,用于在声明用户身份的身份提供商与使用用户身份信息的服务提供商之间交换单点登录信息。 与云目录身份提供商相比, SAML Enterprise 身份提供商的配置更为复杂。

作为服务提供商SAML 企业身份提供商:
  1. IBM® Verify 身份验证委托给负责验证用户的外部身份提供商。 例如,Microsoft ADFS 或 Microsoft Azure AD。
  2. 将返回的用户身份信息填入用户凭据令牌中 Verify
服务提供者身份提供者之间的通信依赖于元数据文件中包含的值。 要启用 SAML 企业身份提供商与外部身份提供商之间的 SAML 单点登录, 身份提供商必须:
  1. SAML Enterprise 身份提供商提供 SAML 2.0 身份提供商元数据文件。
  2. SAML 企业身份提供商处获取 SAML 2.0 服务提供商元数据文件。

SAML 元数据需求

  • 服务提供程序元数据文件和身份提供程序元数据文件的内容必须按照 SAML 2.0 规范。
  • 身份提供商的元数据文件必须包含该身份提供商的公钥,以便 SAML Enterprise 身份提供商能够验证其数字签名。 SAML 元数据必须包含一个 <KeyDescriptor> 元素。 以下是用于签名密钥的 <KeyDescriptor> 元素的示例:
    <md:KeyDescriptor use="signing">
          <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
            <X509Data>
              <X509Certificate>idp.example.com SSO key</X509Certificate>
            </X509Data>
          </KeyInfo>
    </md:KeyDescriptor>
    
  • 服务提供者元数据文件必须至少包含一个 <md:KeyDescriptor use="signing"> 元素。 例如:
    <md:KeyDescriptor use="signing">
          <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
            <X509Data>
              <X509Certificate>(...signing certificate...)</X509Certificate>
            </X509Data>
          </KeyInfo>
    </md:KeyDescriptor>
    
  • 如果 SAML 企业身份提供商使用的是内部根证书或中间CA证书,则证书链中的每个证书都必须包含一个 <X509Certificate> stanza。 例如:
    <KeyDescriptor use="signing">    
         <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
            <X509Data>
              <X509Certificate>...root CA base64 encoded public certificate...</X509Certificate>
              <X509Certificate>...intermediate CA base64 encoded public certificate...</X509Certificate>
              <X509Certificate>...signer base64 encoded public certificate ...</X509Certificate>
            </X509Data> 
         </KeyInfo> 
    </KeyDescriptor>
    
    更新 SAML 元数据中的 和 <md:KeyDescriptor use="encryption"> 两个 <md:KeyDescriptor use="signing"> 元素。
    Verify注意: 服务提供商元数据文件中 `element` <md:KeyDescriptor use="encryption"> 元素内的证书,可由外部身份提供商 SAML 2.0 用于加密并向 SAML2 发送断言元素。

SAML 断言Verify 凭证令牌映射

SAML 企业身份提供商使用 SAML 断言中的用户身份信息来填充:
  • Verify 凭证令牌 ,代表经过身份验证的 Verify Connect 用户。

    用于存储用户的身份及其属性信息。

  • 发往 SaaS 应用程序的出站 SAML 请求
表 1. SAML 断言与凭证令牌映射
SAML 断言元素的值 作为以下内容添加到凭据令牌Verify
<saml:Subject><saml:NameID> preferred_username
<saml:Issuer> realmName,如果 realmName 该声明未明确包含在 SAML 断言中。
注意: 如果 <saml:Issuer> 采用 http(s) URL 这种形式,则 <hostname> 会从 URL 中提取 并用于设置 属性 realmName

<saml:AttributeStatement>SAML 断言中还可以包含其他用户身份信息。 <saml:AttributeValue> 元素仅支持字符串数据类型。

如果 对应于 云目录 Verify 中的以下标准属性之一,则该 <saml:Attribute Name> 属性将作为具有相同属性的标准属性添加到 凭据令牌Verify
  • preferred_username
  • given_name
  • family_name
  • namedisplayName
  • emailemailAddress
  • groupsgroupIds
  • userID
  • realmName
  • mobile_number

如果该 <saml:Attribute Name> 属性与云目录 Verify 中的任何标准属性都不匹配,则该属性将作为扩展属性添加到 Verify 凭据令牌中。 扩展属性在原始属性名称中具有前缀 ext::

emailAddress以下是一个 SAML 响应的示例,其属性断言 <saml:AttributeStatement> 中包含将传播到凭据令牌Verify 、和 mobile_number 属性。
<?xml version="1.0"?>
<samlp:Response xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" 
      xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" 
      xmlns:xs="http://www.w3.org/2001/XMLSchema" 
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
      ID="FIMRSP_549f7c46-014a-195f-b377-f24678dbf88a" 
      IssueInstant="2014-12-16T19:42:25Z" Version="2.0">
  <samlp:Status>
    <samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"/>
  </samlp:Status>
  <saml:Assertion ID="Assertion-uuid549f74ad-014a-120d-a67b-f24678dbf88a" 
      IssueInstant="2014-12-16T19:42:23Z" Version="2.0">
    <saml:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">
         https://idp.example.com/SAML</saml:Issuer>
    <saml:Subject>
      <saml:NameID Format="urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress">testuser
          </saml:NameID>
      <saml:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
        <saml:SubjectConfirmationData NotOnOrAfter="2014-12-16T19:43:23Z" 
             Recipient="https://sp.iam.ibmcloud.com/SAML"/>
      </saml:SubjectConfirmation>
    </saml:Subject>
    <saml:Conditions NotBefore="2014-12-16T19:41:23Z" NotOnOrAfter="2014-12-16T19:43:23Z">
      <saml:AudienceRestriction>
        <saml:Audience>https://sp.iam.ibmcloud.com/SAML</saml:Audience>
      </saml:AudienceRestriction>
    </saml:Conditions>
    <saml:AuthnStatement AuthnInstant="2014-12-16T19:42:23Z" 
           SessionIndex="uuid549ad19a-014a-1451-8e4d-998e0731058a" 
           SessionNotOnOrAfter="2014-12-16T20:42:21Z">
      <saml:AuthnContext>
        <saml:AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:Password
            </saml:AuthnContextClassRef>
      </saml:AuthnContext>
    </saml:AuthnStatement>
    <saml:AttributeStatement>
      <saml:Attribute Name="emailAddress" 
            NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
        <saml:AttributeValue xsi:type="xs:string">testuser@idp.example.com</saml:AttributeValue>
      </saml:Attribute>
      <saml:Attribute Name="mobile_number" 
            NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
        <saml:AttributeValue xsi:type="xs:string">01234556789</saml:AttributeValue>
      </saml:Attribute>    
    </saml:AttributeStatement>
  </saml:Assertion>
</samlp:Response>
以下 JSON 对象是一个非规范示例,展示了从示例 SAML 身份验证响应转换而来的凭证 Verify 令牌中的属性集。 它说明了 SAML 断言中的用户身份和属性是如何映射到凭据令牌中的。
{
"preferred_username":"testuser",
"realmName": "idp.example.com",
"email":"testuser@idp.example.com",
"ext:mobileNumber": "01234556789"
}