在 OAM/ SP 中使用測試 SP 應用程式

本文示範如何在 OAM/SP 中啟用及使用「測試 SP 應用程式」,這在 OAM 設定 SP 和「同盟」協議時非常有用。包含下列功能:

在滾動「聯合 SSO」輸出之前,此工具對於診斷 SAML/OpenID 流程中的問題非常有用。

此 Web 應用程式會透過瀏覽器執行 OAM 的 SP 功能,而不建立任何 OAM 階段作業:

啟用 / 停用測試 SP 引擎

此時會停用 Test SP 應用程式,您必須先啟用此應用程式才能使用它。

注意:使用 Test SP App 完成之後,請將它停用。

若要啟用或停用 Test SP 應用程式,您必須執行下列 OAM WLST 命令:

  1. 執行以下步驟來輸入 WLST 環境:$IAM_ORACLE_HOME/common/bin/wlst.sh

  2. 連線「WLS 管理」伺服器:connect()

  3. 瀏覽至「網域程式實際執行」分支:domainRuntime()

  4. 執行 TestSPEngine() 指令:

    1. 若要啟用「測試 SP 引擎」,請執行下列步驟:configureTestSPEngine("true")

    2. 停用「測試 SP 引擎」:configureTestSPEngine("false")

  5. 結束 WLST 環境:exit()

使用測試 SP 引擎

正在啟動同盟 SSO

啟動「聯合 SSO」流程涉及:

用來存取測試 SP 應用程式的 URL 為:http(s)://oam-runtime-host:oam-runtime-port/oamfed/user/testspss

測試 SP 應用程式會顯示含有 IdPs 清單的下拉式清單,以執行「聯合 SSO」:

Initiate_Federation_SSO.jpg 圖解說明

選取 IdP 之後,請按一下開始 SSO 按鈕,以指定 IdP 觸發聯合 SSO:

測試服務點作業的結果

當 IdP 將具有 SAML 宣告 / OpenID 回應的使用者重新導向至 OAM/SP 時,伺服器會驗證回應、將回應對應至 LDAP 使用者記錄,並將結果傳回至 Test SP 應用程式,其中顯示:

Test_SP_Operation_Result.jpg 圖解說明

診斷問題

如果 IdP 與 OAM/SP 之間的「聯合 SSO」未運作,則 Test SP 引擎可以是具有 OAM 日誌的良好工具來診斷問題。

對應問題

如果內送「SSO 宣告」無法對應至本機 LDAP 使用者記錄,「測試 SP」應用程式會顯示:

在此範例中,IdP 與 OAM/SP 的管理員同意使用 SAML 2.0,並透過電子郵件地址識別使用者。此處的問題是,IdP 的電子郵件地址是 alice.appleton@oralce.com,而在 OAM/SP 使用的 LDAP 目錄中,電子郵件是 alice@oracle.com

測試服務點應用程式會在流程結束時顯示下列資訊:

Mapping_Issues_Result.jpg 圖解說明

OAM 日誌檔會顯示下列錯誤訊息以及 SAML 訊息:

<Feb 28, 2014 7:18:05 AM PST> <Warning>

<oracle.security.fed.eventhandler.fed.proVles.sp.sso.assertion.Saml20AssertionProcessor><FED-15108> <User was not found during configure based authentication using NameIDmapping for name identifier: alice.appleton@oracle.com name identifier format :urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress and message :<samlp:Response xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"Destination="http://adc00pcc.us.oracle.com:23002/oam/server/fed/sp/sso" ID="idaWfL5-f37nhQWh0WWjHbobsVetM-" InResponseTo="id-hqkZGMV-wEO5-CulpYxArIvr91Y14dA-WSRYZ8zP" IssueInstant="2014-02-28T15:18:05Z"Version="2.0"><saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"Format="urn:oasis:names:tc:SAML:2.0:nameidformat:entity">http://adc00peq.us.oracle.com:7499/fed/idp</saml:Issuer><samlp:Status><samlp:StatusCodeValue="urn:oasis:names:tc:SAML:2.0:status:Success"/></samlp:Status><saml:Assertionxmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" ID="id-PoODBDUeoiSY4ajPCQ86yjZWkw-"IssueInstanattributet="2014-02-28T15:18:05Z" Version="2.0"><saml:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameidformat:entity">http://adc00peq.us.oracle.com:7499/fed/idp</saml:Issuer><dsig:Signature xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:SignedInfo><dsig:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/><dsig:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><dsig:Reference URI="#id-PoOD-BDUeoiSY4ajPCQ86yjZWkw-"><dsig:Transforms><dsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/><dsig:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><dsig:DigestValue>X5ojFxrpBOS4klosM5jcBOF8Bqg=</dsig:DigestValue></dsig:Reference></dsig:SignedInfo><dsig:SignatureValue>VJKJOBOowHZ4lVkHjX4w2YHi+0ZAa4ez/+D+ketAQcOxxtwOZPcBYERwkMgazudMh0XEMbIkwsBTVwb4tX+uV327Gjlp1hXc0uYnm2n8mZfen9Ppru6jTES4N7PoD3mOpCfFEHBUJg118DihWGLfzBWw7LMLaN2A</dsig:SignatureValue></dsig:Signature><saml:Subject><saml:NameIDFormat="urn:oasis:names:tc:SAML:1.1:nameidformat:emailAddress">alice.appleton@oracle.com</saml:NameID><saml:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer"><saml:SubjectConfirmationData InResponseTo="id-hqkZGMV-wEO5-CulpYxArIvr91Y14dA-WSRYZ8zP" NotOnOrAfter="2014-02-28T15:23:05Z"Recipient="http://adc00pcc.us.oracle.com:23002/oam/server/fed/sp/sso"/></saml:SubjectConfirmation></saml:Subject><saml:ConditionsNotBefore="2014-02-28T15:18:05Z" NotOnOrAfter="2014-02-28T15:23:05Z"><saml:AudienceRestriction><saml:Audience>http://adc00pcc.us.oracle.com:23002/oam/fed</saml:Audience></saml:AudienceRestriction></saml:Conditions><saml:AuthnStatement AuthnInstant="2014-02-28T15:18:05Z" SessionIndex="id-2i7BY1gGnhukoBSDmrvkBIaG-NI-" SessionNotOnOrAfter="2014-02-28T16:18:05Z"><saml:AuthnContext><saml:AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport</saml:AuthnContextClassRef></saml:AuthnContext></saml:AuthnStatement></saml:Assertion></samlp:Response>

回應驗證問題

如果無法驗證內送「SSO 宣告」,「測試 SP」應用程式會顯示:

在此範例中,IdP 與 OAM/SP 的管理員同意使用 SAML 2.0,但 IdP 未依 OAM/SP 所要求簽署的宣告 (通常已簽署宣告:針對此範例,我停用 IdP 上的簽章以展示錯誤) 測試 SP 應用程式會在流程結束時描述下列資訊:

Response_Validation_Issues_Result.jpg 圖解說明

OAM 日誌檔會顯示下列錯誤訊息以及 SAML 訊息:

<Feb 28, 2014 7:23:05 AM PST> <Error><oracle.security.fed.eventhandler.fed.profiles.utils.CheckUtils> <FEDSTS-18003><Assertion is not signed.><Feb 28, 2014 7:23:05 AM PST> <Error><oracle.security.fed.eventhandler.fed.profiles.sp.sso.v20.ProcessResponseEventHandler><FED-18012> <Assertion cannot be validated: <samlp:Responsexmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"Destination="http://adc00pcc.us.oracle.com:23002/oam/server/fed/sp/sso" ID="id-De7M27k5CWpBsuGzgaxwHgwqV1g-" InResponseTo="id-fX4nHKLCMcAZjHvsKfCORDZLmIDcQMpVYjqmxQb"IssueInstant="2014-02-28T15:23:05Z"Version="2.0"><saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"Format="urn:oasis:names:tc:SAML:2.0:nameidformat:entity">http://adc00peq.us.oracle.com:7499/fed/idp</saml:Issuer><samlp:Status><samlp:StatusCodeValue="urn:oasis:names:tc:SAML:2.0:status:Success"/></samlp:Status><saml:Assertionxmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" ID="id-EAdQSXjroyYNuuWbaBWZVdBtu8-"IssueInstant="2014-02-28T15:23:05Z" Version="2.0"><saml:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameidformat:entity">http://adc00peq.us.oracle.com:7499/fed/idp</saml:Issuer><saml:Subject><saml:NameID Format="urn:oasis:names:tc:SAML:1.1:nameidformat:emailAddress">alice@oracle.com</saml:NameID><saml:SubjectConfirmationMethod="urn:oasis:names:tc:SAML:2.0:cm:bearer"><saml:SubjectConfirmationDataInResponseTo="id-fX4nHKLCMcA-ZjHvsKfCORDZLmIDcQMpVYjqmxQb"NotOnOrAfter="2014-02-28T15:28:05Z"Recipient="http://adc00pcc.us.oracle.com:23002/oam/server/fed/sp/sso"/></saml:SubjectConfirmation></saml:Subject><saml:ConditionsNotBefore="2014-02-28T15:23:05Z" NotOnOrAfter="2014-02-28T15:28:05Z"><saml:AudienceRestriction><saml:Audience>http://adc00pcc.us.oracle.com:23002/oam/fed</saml:Audience></saml:AudienceRestriction></saml:Conditions><saml:AuthnStatement AuthnInstant="2014-02-28T15:23:05Z" SessionIndex="id--0QWpaU2AV-L7UpNvLH5Bn7Z5Xk-" SessionNotOnOrAfter="2014-02-28T16:23:05Z"><saml:AuthnContext><saml:AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport</saml:AuthnContextClassRef></saml:AuthnContext></saml:AuthnStatement></saml:Assertion></samlp:Response>

其他學習資源

探索 docs.oracle.com/learn 上的其他實驗室,或存取 Oracle Learning YouTube 頻道上的更多免費學習內容。此外,瀏覽 education.oracle.com/learning-explorer 成為 Oracle Learning Explorer。

如需產品文件,請造訪 Oracle Help Center