使用 SAML(安全標記主張語言)記號來鑑別 Web 服務用戶端

Web Services Security SAML Token Profile 1.1 定義如何將「安全主張標記語言 (SAML) 1.1 版和 2.0 版」的主張,與「Web 服務安全 (WSS):SOAP 訊息安全 1.1 版」規格搭配使用。Liberty 支援使用載送確認方法的 Web Services Security SAML Token Profile 1.1 for SAML 2.0 版主張。

關於這項作業

Liberty 支援使用載送確認方法 (<SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">) 的 SAML 2.0 版。Web 服務用戶端將 SAML 記號傳播到 Web 服務提供者,來作為識別要求端的方法,而 Web 服務提供者可以使用這項 SAML 記號資訊,來鑑別要求端。

會以 WS-Security 原則中其中一個支援的記號,來表示 SAML 記號需求。您可以新增 SamlToken 需求,作為其中一個支援記號主張中的必要記號,其中包含:SupportingTokensSignedSupportingTokensSignedEncryptedSupportingTokensEncryptedSupportingTokens

程序

  1. 將 Web 服務用戶端配置成傳播 SAML 記號。

    Saml20Token (com.ibm.websphere.security.saml2.Saml20Token) 必須存在於 RunAs 主體中。如果配置 SamlToken 原則主張,Liberty WS-Security 執行時期會自動從 RunAs 主體擷取 Saml20Token,並將 SAML 主張附加到 <wsse:Security> SOAP 標頭中。必要步驟如下:

    1. server.xml 檔中,將 wsSecuritySaml-1.1 新增至 featureManager
      <featureManager>
              <feature>wsSecuritySaml-1.1</feature>
      </featuremanager>
    2. 應用程式必須在 .wsdl 檔的原則中,指定 SAML 記號作為支援記號 (包括 SupportingTokensSignedSupportingTokensSignedEncryptedSupportingTokensEncryptedSupportingTokens 記號主張)。
      <wsp:Policy wsu:Id="CallerHttpPolicy">
      	<sp:SupportingTokens>
      		<wsp:Policy>
      			<sp:SamlToken
      				sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient">
      				<wsp:Policy>
      					<sp:WssSamlV20Token11 />
      				</wsp:Policy>
      			</sp:SamlToken>
      		</wsp:Policy>
      	</sp:SupportingTokens>
      
      </wsp:Policy>
  2. 使用 SAML 記號來鑑別 Web 服務。

    當 Web 服務提供者收到含有 SAML 記號的 SOAP 訊息時,它會先驗證記號,然後使用 SAML 記號屬性來完成鑑別程序。以下是驗證 SAML 記號時所涉及的步驟:

    1. server.xml 檔中,將 wsSecuritySaml-1.1 新增至 featureManager
      <featureManager>
              <feature>wsSecuritySaml-1.1</feature>
      </featuremanager>
    2. 應用程式必須在 .wsdl 檔內的原則中,指定 SAML 記號作為支援記號。
    3. 當驗證記號時,會使用伺服器配置中的下列屬性。
      <wsSecurityProvider id="default"
                ..
                ..
                <samltoken
                     wantAssertionsSigned="true"
                     clockSkew="5m"
                     timeToLive="30m"
                     requiredSubjectConfirmationMethod="bearer"
                     audienceRestrictions="https://../aud1"
                     audienceRestrictions="aud2" ..          />
                      
                      
      </wsSecurityProvider>
    • wantAssertionsSigned - 指定是否簽署 WS-Security 提供者所收到之 SOAP 訊息中的 <saml:Assertion> 元素。
    • clockSkew - 產生 SAML 記號與收到 SAML 記號的系統之間所容許的時間差異。預設值為 5 分鐘。
    • timeToLive - SAML 主張的生命期限。當 SAML 主張中遺漏 NoOnOrAfter 條件時,則需要這項設定。預設值為 30 分鐘。
    • requiredSubjectConfirmationMethod - SAML 主張中的主體確認方法。預設值為 bearer
    • audienceRestrictions - 容許的 SAML 主張對象。預設值是所有容許的對象。

    如需涉及鑑別之步驟的進一步詳細資料,請參閱建立 WS-Security SAML 呼叫端配置


指示主題類型的圖示 作業主題



「時間戳記」圖示 前次更新: 2016 年 11 月 30 日
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=twlp_auth_saml_token
檔名:twlp_auth_saml_token.html