在 OAM/SP 中使用测试 SP 应用程序
本文说明了如何在 OAM/SP 中启用和使用测试 SP 应用程序,这在 OAM 是 SP 和联盟协议设置时非常有用。它提供了以下功能:
-
测试联盟 SSO 流
-
验证映射规则是否有效
-
查看 IdP 发送的属性、这些属性的命名方式以及 OAM/SP 如何处理它们
-
请参见联盟标记(SAML 断言或 OpenID SSO 响应)
在将联合 SSO 滚动出之前,此工具对于诊断 SAML/OpenID 流中的问题非常有用。
这是一个 Web 应用程序,它通过浏览器练习 OAM 的 SP 功能而无需创建任何 OAM 会话:
-
通过浏览器访问应用程序
-
使用指定的 IdP 启动联盟 SSO
-
您可通过 IdP 进行身份验证
-
OAM/SP 处理 SAML 断言/OpenID SSO 响应 应用程序显示结果和 SAML 断言/OpenID SSO 响应
启用/禁用测试 SP 引擎
现成,测试 SP 应用程序已禁用,您必须先启用它,然后才能使用它。
注:使用测试 SP 应用程序完成后,应将其禁用。
要启用或禁用 Test SP 应用程序,需要执行以下 OAM WLST 命令:
-
通过执行
$IAM_ORACLE_HOME/common/bin/wlst.sh进入 WLST 环境。 -
连接到 WLS 管理服务器:
connect()。 -
导航到域运行时分支:
domainRuntime()。 -
执行
TestSPEngine()命令:-
要启用测试 SP 引擎:
configureTestSPEngine("true") -
禁用测试 SP 引擎:
configureTestSPEngine("false")
-
-
退出 WLST 环境:
exit()。
使用测试 SP 引擎
正在启动联盟 SSO
启动联盟 SSO 流涉及:
-
通过浏览器转到 Test SP 应用程序
-
选择 IdP 以执行联合 SSO
-
开始操作
用于访问 Test SP 应用程序的 URL 为:http(s)://oam-runtime-host:oam-runtime-port/oamfed/user/testspss
测试 SP 应用程序将显示一个下拉列表,其中包含用于通过以下项执行联盟 SSO 的 IdPs 列表:
-
选择 IdP
-
或者选择其中一个引用作为默认值,这指示 OAM/SP 使用默认 SSO IdP

插图 Initiate_Federation_SSO.jpg 的说明
选择 IdP 后,单击启动 SSO 按钮以使用指定的 IdP 触发联合 SSO:
-
您将重定向到 IdP,类似于正常的联盟 SSO 操作
-
(IdP 不知道您正在使用与 OAM 捆绑在一起的测试 SP 应用程序:IdP 仅知道 OAM/SP 正在执行联盟 SSO)IdP 可以:
-
质询您的凭据,然后发送 SAML/OpenID 响应
-
发送 SAML/OpenID 响应(因为您已通过验证,或者因为出现错误)
测试 SP 操作的结果
当 IdP 将具有 SAML 断言/OpenID 响应的用户重定向到 OAM/SP 时,服务器将验证响应,将其映射到 LDAP 用户记录,并将结果返回到测试 SP 应用程序,其中显示:
-
验证操作的结果
-
响应映射到的规范用户 ID,其中包含
-
身份存储库名称
-
用户的 DN
-
用户的 ID
-
验证即时消息
-
IdP 合作伙伴名称
-
存储在 OAM 会话中的 SSO 响应的属性
-
解密/解码的 SSO 响应

插图 Test_SP_Operation_Result.jpg 的说明
诊断问题
如果 IdP 与 OAM/SP 之间的联盟 SSO 不起作用,则测试 SP 引擎是使用 OAM 日志诊断问题的有效工具。
映射问题
如果传入 SSO 断言无法映射到本地 LDAP 用户记录,则测试 SP 应用程序可以显示:
-
错误消息
-
IdP 发送的名称 ID/属性
-
IdP 发送的 SSO 消息,其中包含 NameID/attributes
在此示例中,IdP 和 OAM/SP 的管理员同意使用 SAML 2.0,并通过电子邮件地址标识用户。此处的问题是,IdP 中的 alice 的电子邮件地址为 alice.appleton@oralce.com,而 OAM/SP 使用的 LDAP 目录中的电子邮件为 alice@oracle.com
测试 SP 应用程序在流末尾显示以下信息:
-
验证操作失败
-
断言无法映射到本地用户记录
-
从断言中提取的数据以及消息本身

插图 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 发送的 SSO 消息
在此示例中,IdP 和 OAM/SP 的管理员同意使用 SAML 2.0,但 IdP 未按照 OAM/SP 的要求对断言进行签名(通常对断言进行签名:在此示例中,我禁用了 IdP 上的签名以显示错误)测试 SP 应用程序在流结束时描述了以下信息:
-
验证操作失败
-
无法验证断言
-
SAML 消息

插图 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 帮助中心。