带有 2 个 SP 的 SimpleSAMLphp IDP 的 SLO 问题:重定向到错误的登录屏幕

SLO issue with SimpleSAMLphp IDP with 2 SPs : redirected to the wrong login screen

我们已将 SimpleSAMLphp 设置为 SAML IDP,其中注册了 2 个 SP(Liferay 和 MyWebMethods)。

每个 SP 都在 simplesamlphp/metadata/saml20-sp-remote.php 文件中使用自己的 ACS 和 SLO 链接注册到 IDP。像 :

// MWS = SP2
$metadata['http://sp2.siteweb.com'] = array(
    'AssertionConsumerService' => 'http://sp2.siteweb.com/',
    'SingleLogoutService' => 'http://sp2.siteweb.com/?method=logout',
);

// LR = SP1
$metadata['http://sp1.siteweb.com/c/portal/saml/metadata'] = array(
    'AssertionConsumerService' => 'http://sp1.siteweb.com/c/portal/saml/acs',
    'SingleLogoutService' => 'http://sp1.siteweb.com/c/portal/saml/sls',
);

我使用 SSO 没有问题:在我通过身份验证(通过 IDP)后,我可以到达第一个 SP,然后我可以转到第二个 SP,而无需再次登录。

我的问题是当用户从同一会话(Google Chrome 中的 2 个选项卡)同时连接到 2 个 SP 中的每一个时注销 (SLO)。如果他先从 SP2 注销,每当他尝试从 SP1 注销时,他都会被重定向到 SP2 的登录屏幕(即:正常的 SSO 登录屏幕),而不是被重定向到 IDP 登录屏幕.

注销 url 实际上被我们的 SP 过滤器捕获,然后我们创建一个 saml Auth 对象来执行注销():

Auth auth = new Auth(request, response);
String relayState = sp1_login_url;
auth.logout(relayState);

一个信息是SP1支持SP发起,SP2只支持IDP发起。

有什么想法吗?

经过一些研究,解决方案只是在 SP2 的配置中添加一个 returnUrl 参数:

// MWS = SP2
$metadata['http://sp2.siteweb.com'] = array(
    'AssertionConsumerService' => 'http://sp2.siteweb.com/',
    'SingleLogoutService' => 'http://sp2.siteweb.com/?method=logout&returnUrl=http://idplogin.siteweb.com',
);