DIV CSS 佈局教程網

 DIV+CSS佈局教程網 >> 網頁腳本 >> XML學習教程 >> XML詳解 >> 理解 IBM InfoSphere MDM Server 安全性 4
理解 IBM InfoSphere MDM Server 安全性 4
編輯:XML詳解     

簡介

  IBM InfoSphere MDM Server 允許用戶按自己的格式在 MDM 安全框架中傳遞和處理安全數據。本文簡要介紹如何使用這種機制支持 SAML 斷言。它延續前一篇文章(理解 IBM InfoSphere MDM Server 安全性)中的 “身份驗證和身份斷言” 小節。

  可以使用控制對象把 SAML 身份驗證和身份屬性語句傳遞給 MDM Server。在 MDM Server 中,解析這些 SAML 斷言,提取出用戶身份和組成員關系。這些語句保持 XML 格式,可以支持各種擴展(業務代理、數據擴展或行為擴展)。

  定義 SAML

  SAML 代表 Security Assertion Markup Language。Wikipedia 上把 SAML 定義為 “一種基於 XML 的標准,用於在安全域之間,也就是在身份提供者(斷言的生產者)和服務提供者(斷言的消費者)之間,交換身份驗證和授權數據。SAML 是由 OASIS Security Services Technical Committee 開發的”。

  把用戶身份信息傳遞給 MDM Server

  MDM Server 為客戶機提供了幾種調用服務操作的方法:

  通過 RMI/IIOP 在服務控制器上直接調用

  通過 HTTP 以 web 服務操作的形式調用

  通過 JMS 異步地調用

  無論選擇哪個接口,所有調用最終會到達服務控制器。服務控制器作為請求和響應框架的入口點。根據事務上下文選擇一個請求解析器,請求解析器對請求業務對象進行解析;這個對象的頭包含一個控制對象,體包含一個事務對象。

  MDM Server 要求在控制對象中傳遞的用戶身份信息是明文文本值或 SAML 斷言。

  明文文本值

  可以使用控制對象的 requesterName 和 userRoles 屬性以明文文本值形式把用戶身份信息傳遞給 MDM Server。一個用戶可以具有多個用戶角色,這些角色可以一個接一個地傳遞給 MDM Server。

清單 1 給出用戶 Jane Doe 的請求示例,requesterName 是 'jdoe',這個用戶具有兩個角色 CallCentAppUser 和 CstSuppRelL2。

  清單 1. 以明文文本形式傳遞的用戶身份信息

<?XML version="1.0" encoding="UTF-8"?>
<TCRMService xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:noNamespaceSchemaLocation="myTCRM.xsd">
  <RequestControl>
    <requestID>123501</requestID>
    <DWLControl>
. . .
      <requesterName>jdoe</requesterName>
      <userRole>CallCentAppUser</userRole>
      <userRole>CstSuppRepL2</userRole>
. . .
    </DWLControl>
  </RequestControl>
  <TCRMTx>
. . .
</TCRMTx>
</TCRMService>

  SAML 斷言

  還可以以身份驗證斷言形式把用戶身份信息傳遞給 MDM Server,身份驗證斷言包含用戶身份及其屬性(角色)。

  由服務消費者負責把 SAML 斷言傳遞給 MDM Server。服務消費者可以從身份提供者那裡直接獲取 SAML 斷言,也可以獲取其他格式的身份數據並把數據轉換為 SAML 斷言。

  在事務生命周期的各個階段,都會傳遞 SAML 斷言語句,因此各種擴展也可以使用它們。在默認情況下,MDM Server 能夠從 AuthenticationData 中獲取控制對象的 requesterName 和 userRoles 屬性。取自 SAML 斷言的信息優先於通過控制對象屬性傳遞的信息。在引入 SAML 斷言集成特性之前的 MDM Server 版本中,一直使用控制對象的 requesterName 和 userRoles 屬性。即使在 SAML 斷言中傳遞用戶身份信息,MDM Server 中的不同地方仍然使用 requesterName 和 userRoles 屬性。

下面的清單 2 給出用戶 Jane Doe 的請求示例,其身份是 'jdoe',這個用戶具有兩個角色 CallCentAppUser 和 CstSuppRelL2。注意,'jdoe' 作為 AuthenticationStatement 中的 NameIdentifIEr 傳遞,兩個角色 CallCentAppUser 和 CstSuppRelL2 作為 AttributeStatement 中的 AttributeValue 傳遞。

  清單 2. 以 SAML 斷言形式傳遞的用戶身份信息

<?XML version="1.0" encoding="UTF-8"?>
<TCRMService xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:noNamespaceSchemaLocation="myTCRM.xsd">
  <RequestControl>
    <requestID>123501</requestID>
    <DWLControl>
. . .
<authData><![CDATA[
<saml:Assertion XMLns:saml="urn:oasis:names:tc:SAML:1.0:assertion"
 MajorVersion="1" MinorVersion="1" AssertionID=". . ."
 Issuer=". . ." IssueInstant="2008-11-21T10:35:18.796Z"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="urn:oasis:names:tc:SAML:1.0:assertion
  oasis-sstc-saml-schema-assertion-1.1.xsd">
 <saml:Conditions NotBefore=". . ." NotOnOrAfter=". . .">. . .</saml:Conditions>
 <saml:AuthenticationStatement
  AuthenticationMethod="urn:oasis:names:tc:SAML:1.0:am:passWord"
  AuthenticationInstant="2008-11-21T10:35:08.707Z">
  <saml:Subject>
   <saml:NameIdentifIEr
    Format="urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifIEdName">
     jdoe
   </saml:NameIdentifIEr>
  </saml:Subject>
 </saml:AuthenticationStatement>
 <saml:AttributeStatement>
  <saml:Subject>
   <saml:SubjectConfirmation>
    <saml:ConfirmationMethod>. . .</saml:ConfirmationMethod>
   </saml:SubjectConfirmation>
   </saml:Subject>
  <saml:Attribute AttributeName="urn:wcc:dir:attribute-def:userRoles"
   AttributeNamespace="urn:wcc:attributeNamespace:uri">
   <saml:AttributeValue>
    CallCentAppUser
   </saml:AttributeValue>
   <saml:AttributeValue>
    CstSuppRepL2
   </saml:AttributeValue>
  </saml:Attribute>
 </saml:AttributeStatement>
</saml:Assertion>
]]></authData>
. . .
    </DWLControl>
  </RequestControl>
  <TCRMTx>
. . .
</TCRMTx>
</TCRMService>


把 SAML 斷言集成到 MDM Server 安全框架中

  MDM Server 安全框架定義了解析事務請求中的身份驗證斷言所需的接口。身份驗證斷言的格式可以由用戶決定。MDM Server 附帶一個默認的身份驗證斷言解析器,它支持使用 SAML。在默認情況下,支持 SAML 1.1 斷言。

  下面的類圖說明 SAML 斷言、安全數據解析器和控制對象之間的關系。

  圖 1. 使用 SAML11parser 解析用戶身份信息

理解 IBM InfoSphere MDM Server 安全性 4

  下面是在 MDM Server 中使用 SAML 斷言的步驟:

  請求解析器調用控制對象中的 setAuthData() 方法,從而設置來自事務請求中的 authData 標記值的 SAML 斷言。

  選用 SAML11Parser 解析 SAML 斷言。這個解析器實現 ISecurityDataParser 接口。

  SAML11Parser 用從 SAML 斷言解析出的用戶 ID 和/或用戶角色填充 AuthenticationData 對象。原來的 SAML 斷言也存儲在 AuthenticationData 中。

  控制對象包含 AuthenticationData。在整個事務處理過程中,作為事務上下文對象傳遞控制對象。因此,MDM Server 和擴展在整個事務處理過程中都可以使用 SAML 斷言。

  請求和響應示例

  清單 3 是 addContract 事務的 XML 請求示例。在這個請求示例中,以 SAML 斷言的形式傳遞用戶身份信息。

  清單 3. addContract 事務請求,以 SAML 斷言的形式傳遞用戶身份信息

<?XML version="1.0" encoding="UTF-8"?>
<TCRMService xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:noNamespaceSchemaLocation="myTCRM.xsd">
  <RequestControl>
    <requestID>123501</requestID>
    <DWLControl>
      <requesterLanguage>100</requesterLanguage>
<authData><![CDATA[
<saml:Assertion XMLns:saml="urn:oasis:names:tc:SAML:1.0:assertion"
 MajorVersion="1" MinorVersion="1" AssertionID=". . ."
 Issuer=". . ." IssueInstant="2008-11-21T10:35:18.796Z"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="urn:oasis:names:tc:SAML:1.0:assertion
  oasis-sstc-saml-schema-assertion-1.1.xsd">
 <saml:Conditions NotBefore=". . ." NotOnOrAfter=". . .">. . .</saml:Conditions>
 <saml:AuthenticationStatement
  AuthenticationMethod="urn:oasis:names:tc:SAML:1.0:am:passWord"
  AuthenticationInstant="2008-11-21T10:35:08.707Z">
  <saml:Subject>
   <saml:NameIdentifIEr
    Format="urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifIEdName">
     jdoe
   </saml:NameIdentifIEr>
  </saml:Subject>
 </saml:AuthenticationStatement>
 <saml:AttributeStatement>
  <saml:Subject>
   <saml:SubjectConfirmation>
    <saml:ConfirmationMethod>. . .</saml:ConfirmationMethod>
   </saml:SubjectConfirmation>
   </saml:Subject>
  <saml:Attribute AttributeName="urn:wcc:dir:attribute-def:userRoles"
   AttributeNamespace="urn:wcc:attributeNamespace:uri">
   <saml:AttributeValue>
    CallCentAppUser
   </saml:AttributeValue>
   <saml:AttributeValue>
    CstSuppRepL2
   </saml:AttributeValue>
  </saml:Attribute>
 </saml:AttributeStatement>
</saml:Assertion>
]]></authData>
    </DWLControl>
  </RequestControl>
  <TCRMTx>
    <TCRMTxType>addContract</TCRMTxType>
    <TCRMTxObject>TCRMContractBObj</TCRMTxObject>
    <TCRMObject>
      <TCRMContractBObj>
        <ContractIdPK/>
        <LineOfBusiness>life ins</LineOfBusiness>
        <CurrencyType>1</CurrencyType>
        <FrequencyModeType>1</FrequencyModeType>
        <BillingType>5</BillingType>
        <PremiumAmount>200</PremiumAmount>
        <NextBillingDate>2009-01-01</NextBillingDate>
        <CurrentCashValueAmount>300.00</CurrentCashValueAmount>
        <BrandName>ul</BrandName>
        <ServiceOrgName>KLM</ServiceOrgName>
        <ServiceProvId>1991</ServiceProvId>
        <BusOrgunitId>444</BusOrgunitId>
      </TCRMContractBObj>
    </TCRMObject>
  </TCRMTx>
</TCRMService>


 

清單 4 是這個事務的 XML 響應示例。在這個響應 XML 中返回 SAML 斷言。

  清單 4. addContract 事務響應,在響應中返回傳遞的 SAML 斷言

<?XML version="1.0" encoding="UTF-8"?>
<TCRMService xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:noNamespaceSchemaLocation="tCRMResponse.xsd">
  <ResponseControl>
    <ResultCode>SUCCESS</ResultCode>
    <ServiceTime>125</ServiceTime>
    <DWLControl>
      <requesterLanguage>100</requesterLanguage>
      <requesterLocale>en</requesterLocale>
      <requesterName>jdoe</requesterName>
      <requestID>123501</requestID>
      <userRole>CallCentAppUser</userRole>
      <userRole>CstSuppRepL2</userRole>
<authData><![CDATA[
<saml:Assertion XMLns:saml="urn:oasis:names:tc:SAML:1.0:assertion"
 MajorVersion="1" MinorVersion="1" AssertionID=". . ."
 Issuer=". . ." IssueInstant="2008-11-21T10:35:18.796Z"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="urn:oasis:names:tc:SAML:1.0:assertion
  oasis-sstc-saml-schema-assertion-1.1.xsd">
 <saml:Conditions NotBefore=". . ." NotOnOrAfter=". . .">. . .</saml:Conditions>
 <saml:AuthenticationStatement
  AuthenticationMethod="urn:oasis:names:tc:SAML:1.0:am:passWord"
  AuthenticationInstant="2008-11-21T10:35:08.707Z">
  <saml:Subject>
   <saml:NameIdentifIEr
    Format="urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifIEdName">
     jdoe
   </saml:NameIdentifIEr>
  </saml:Subject>
 </saml:AuthenticationStatement>
 <saml:AttributeStatement>
  <saml:Subject>
   <saml:SubjectConfirmation>
    <saml:ConfirmationMethod>. . .</saml:ConfirmationMethod>
   </saml:SubjectConfirmation>
   </saml:Subject>
  <saml:Attribute AttributeName="urn:wcc:dir:attribute-def:userRoles"
   AttributeNamespace="urn:wcc:attributeNamespace:uri">
   <saml:AttributeValue>
    CallCentAppUser
   </saml:AttributeValue>
   <saml:AttributeValue>
    CstSuppRepL2
   </saml:AttributeValue>
  </saml:Attribute>
 </saml:AttributeStatement>
</saml:Assertion>
]]></authData>
    </DWLControl>
  </ResponseControl>
  <TxResponse>
    <RequestType>addContract</RequestType>
    <TxResult>
      <ResultCode>SUCCESS</ResultCode>
    </TxResult>
    <ResponSEObject>
      <TCRMContractBObj>
        <BillingType>5</BillingType>
        <BillingValue>Payroll Deduction</BillingValue>
        <BrandName>ul</BrandName>
        <BusOrgunitId>444</BusOrgunitId>
        <ContractIdPK>938122728173367195</ContractIdPK>
        <ContractLastUpdateDate>2008-11-21 10:35:33.671</ContractLastUpdateDate>
        <ContractLastUpdateTxId>430122728173365655</ContractLastUpdateTxId>
        <ContractLastUpdateUser>jdoe</ContractLastUpdateUser>
        <CurrencyType>1</CurrencyType>
        <CurrencyValue>U.S. Dollar</CurrencyValue>
        <CurrentCashValueAmount>300.00</CurrentCashValueAmount>
        <FrequencyModeType>1</FrequencyModeType>
        <FrequencyModeValue>Annual</FrequencyModeValue>
        <LineOfBusiness>life ins</LineOfBusiness>
        <NextBillingDate>2009-01-01 23:59:59.0</NextBillingDate>
        <PremiumAmount>200</PremiumAmount>
        <ServiceOrgName>KLM</ServiceOrgName>
        <ServiceProvId>1991</ServiceProvId>
        <DWLStatus>
          <Status>0</Status>
        </DWLStatus>
      </TCRMContractBObj>
    </ResponSEObject>
  </TxResponse>
</TCRMService>  

  使用其他安全數據格式

  正如前面提到的,安全數據格式可以由用戶決定。客戶機以 CDATA 格式在 authData 標記中傳遞安全數據。請求和響應框架中的請求解析器保持 authData 不變並設置控制對象。定制的安全數據解析器從 authData 中解析出用戶 ID 和用戶角色。請求和響應框架中的構造器構造響應並按照傳遞請求所用的格式返回 authData。

  下面是使用其他安全數據格式的步驟:

  創建一個實現 ISecurityDataParser 接口的解析器。

  用剛才創建的類的名稱設置配置存儲庫中的配置項 /DWLCommonServices/Security/SAML/security_data_parser。

  把新的類打包在 jar 文件中並讓 MDM Server 企業應用程序可以使用這個 jar 文件。

  在 DWLCommonServices EJB 項目的 MANIFEST.MF 文件中添加 jar 文件名。

  重新啟動服務器,使用新的安全數據格式進行測試。

  結束語

  InfoSphere MDM Server 安全框架提供一種靈活的機制,允許客戶機按照自己的格式傳遞用戶的身份信息。MDM Server 在默認情況下支持 SAML 斷言,而且很容易根據需要使用其他安全數據格式。


 

 

XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved