【发布时间】:2020-01-03 13:46:24
【问题描述】:
我已成功配置 SAML SSO,OpenAM 作为 SP,PingFederate 作为 IDP,使用 SP 发起的 SSO 并使用 Redirect-Post 绑定。我正在使用 kerberos 适配器来实现 SSO。
但是,我无法将 RelayState 参数从 OpenAM 传递到 PF,并在成功验证后将其作为 SAML 自动发布表单的一部分取回。它总是重定向到 OpenAM 断言处理服务,即 openam/metalias/sp
我尝试过的事情 -
我在名为“RelayState”的属性映射中的 Idp 中创建了绑定,但它显示为已签名 SAMLResponse 的一部分,而不是自动回发表单中的额外参数,因此 openam 无法获取 RelayState。
我还尝试将 RelayState 作为 url 编码传递,以及使用名称 TargetResource 传递它。但没有运气。
<!-- template name: form.autopost.template.html -->
#set( $messageKeyPrefix = "form.autopost.template." )
<html>
<head>
<title>$templateMessages.getMessage($messageKeyPrefix, "title")</title>
<meta name="referrer" content="origin"/>
<meta http-equiv="x-ua-compatible" content="IE=edge" />
</head>
<body onload="javascript:document.forms[0].submit()">
<noscript>
<p>
<strong>$templateMessages.getMessage($messageKeyPrefix, "noteTitle"):</strong> $templateMessages.getMessage($messageKeyPrefix, "note")
</p>
</noscript>
<form method="post" action="$action">
#foreach( $name in $formControls.keySet() )
<input type="hidden" name="$escape.escape($name)" value="$escape.escape($formControls.get($name))"/>
#end
<input type="hidden" name="RelayState" value="https://www.google.com"/>
<noscript><input type="submit" value="$templateMessages.getMessage($messageKeyPrefix, "resume")"/></noscript>
</form>
</body>
</html>
出于好奇,我修改了 pingfederate 自动发布表单以强制包含 RelayState 参数,并且它起作用了。
所以我需要找到一种方法,将这些信息传递给 PF,然后 PF 可以在完成身份验证后将其传递回 SP-OpenAM,向 SAMLResponse 表单添加额外的参数。
【问题讨论】:
-
对于 SP-init,根据规范,SP 应在
AuthnRequest的RelayState参数中向 IdP 发送不透明值,而不是 URL。此值应该是在 SP 处捕获的键值对的键,其中值保存 SSO 完成后用户应重定向的位置。 PingFederate 将使用RelayState中的相同值回复AuthnRequest。 SP 应该查找要重定向用户的位置并将用户发送出去。我怀疑您没有正确启动 SP-init 事务,但我不熟悉 OpenAM 以提供更多帮助。 -
您如何从 OpenAM 触发 SP 发起的 SSO?您使用的是 'saml2/jsp/spSSOInit.jsp'(相当于 URI 'spssoinit')吗?
-
@BernhardThalmayr 嗨,我们正在为 Sp-init 使用 Redirect-Post 技术。所以 SP 将重定向到 IDP。它由身份验证模块驱动。在模块中我们配置 IDP 实体 ID,在联邦中我们有信任圈。因此,当请求到达联邦信任圈中的特定模块时。
-
如果您使用的是 SAML2 身份验证模块,那么实际上 OpenAM 会在 SAML 流程成功后将浏览器发送回用于触发身份验证的 URL('goto' 参数的值)。你想在其他地方结束吗?
-
@BernhardThalmayr - 是的,我正在使用 SAML2 身份验证模块。模块名称是 PingSAML.. 所以当我点击 host:port/openam/UI/Login?module=PingSAML&goto=/openam/… 时,它会重定向到 IDP 并在成功时转到“/openam/Consumer/metaAlias/sp”。 IDP 不知道 goto/relaystate 参数。它也不会将其发送回 SP 作为响应。我尝试在重定向请求中使用“RelayState”而不是“goto”作为键,但结果相同。总是回到 /openam/Consumer/metaAlias/ - 断言消费者服务问题是没有填充 goto 参数
标签: single-sign-on kerberos saml-2.0 openam pingfederate