Skip to content
Snippets Groups Projects
Commit 1f225dda authored by Olav Morken's avatar Olav Morken
Browse files

iframe-logout: Improvements in behaviour when one of the SPs doesn't support SLO.

Fixes issue 187

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1795 44740490-163a-0410-bde0-09ae8108e29a
parent 02b843a6
No related branches found
No related tags found
No related merge requests found
...@@ -50,6 +50,7 @@ function startslo() { ...@@ -50,6 +50,7 @@ function startslo() {
$("#hiddeniframecontainer").html("' . str_replace('"', '\"', $iframehtml) . '"); $("#hiddeniframecontainer").html("' . str_replace('"', '\"', $iframehtml) . '");
$("table#slostatustable tr.onhold").removeClass("onhold").addClass("inprogress"); $("table#slostatustable tr.onhold").removeClass("onhold").addClass("inprogress");
/* $("div.completedButWarnings").show(); */ /* $("div.completedButWarnings").show(); */
' . ($iframehtml === '' ? 'sendResponse();' : '') . '
setTimeout("toolong()", 16000); setTimeout("toolong()", 16000);
} }
...@@ -64,7 +65,7 @@ function slocompletesp($entityhash) { ...@@ -64,7 +65,7 @@ function slocompletesp($entityhash) {
function slocompleted() { function slocompleted() {
/* $("div.completedButWarnings").show(); */ /* $("div.completedButWarnings").show(); */
$("div#interrupt").hide(); $("div#interrupt").hide();
' . ($nologoutSPs ? ' ' : 'setTimeout("sendResponse()", 2000);') . ' setTimeout("sendResponse()", 2000);
} }
function sendResponse() { function sendResponse() {
......
...@@ -104,7 +104,30 @@ function updateslostatus() { ...@@ -104,7 +104,30 @@ function updateslostatus() {
$templistofsps = $session->get_sp_list(SimpleSAML_Session::STATE_ONLINE); $templistofsps = $session->get_sp_list(SimpleSAML_Session::STATE_ONLINE);
$listofsps = array(); $listofsps = array();
foreach ($templistofsps AS $spentityid) { foreach ($templistofsps AS $spentityid) {
if (!empty($_COOKIE['spstate-' . sha1($spentityid)])) $listofsps[] = $spentityid; if (!empty($_COOKIE['spstate-' . sha1($spentityid)])) {
$listofsps[] = $spentityid;
continue;
}
try {
$spmetadata = $metadata->getMetaData($spentityid, 'saml20-sp-remote');
} catch (Exception $e) {
/*
* For some reason, the metadata for this SP is no longer available. Most
* likely it was deleted from the IdP while the user had a session to it.
* In any case - skip this SP.
*/
$listofsps[] = $spentityid;
continue;
}
if (!isset($spmetadata['SingleLogoutService'])) {
/* No logout endpoint. */
$listofsps[] = $spentityid;
continue;
}
/* This SP isn't ready yet. */
} }
SimpleSAML_Logger::debug('SAML2.0 - IdP.SingleLogoutServiceiFrame: templistofsps ' . join(',', $templistofsps)); SimpleSAML_Logger::debug('SAML2.0 - IdP.SingleLogoutServiceiFrame: templistofsps ' . join(',', $templistofsps));
SimpleSAML_Logger::debug('SAML2.0 - IdP.SingleLogoutServiceiFrame: listofsps ' . join(',', $listofsps)); SimpleSAML_Logger::debug('SAML2.0 - IdP.SingleLogoutServiceiFrame: listofsps ' . join(',', $listofsps));
......
...@@ -97,7 +97,30 @@ function updateslostatus() { ...@@ -97,7 +97,30 @@ function updateslostatus() {
$templistofsps = $session->get_sp_list(SimpleSAML_Session::STATE_ONLINE); $templistofsps = $session->get_sp_list(SimpleSAML_Session::STATE_ONLINE);
$listofsps = array(); $listofsps = array();
foreach ($templistofsps AS $spentityid) { foreach ($templistofsps AS $spentityid) {
if (!empty($_COOKIE['spstate-' . sha1($spentityid)])) $listofsps[] = $spentityid; if (!empty($_COOKIE['spstate-' . sha1($spentityid)])) {
$listofsps[] = $spentityid;
continue;
}
try {
$spmetadata = $metadata->getMetaData($spentityid, 'saml20-sp-remote');
} catch (Exception $e) {
/*
* For some reason, the metadata for this SP is no longer available. Most
* likely it was deleted from the IdP while the user had a session to it.
* In any case - skip this SP.
*/
$listofsps[] = $spentityid;
continue;
}
if (!isset($spmetadata['SingleLogoutService'])) {
/* No logout endpoint. */
$listofsps[] = $spentityid;
continue;
}
/* This SP isn't ready yet. */
} }
SimpleSAML_Logger::debug('SAML2.0 - IdP.SingleLogoutServiceiFrame: templistofsps ' . join(',', $templistofsps)); SimpleSAML_Logger::debug('SAML2.0 - IdP.SingleLogoutServiceiFrame: templistofsps ' . join(',', $templistofsps));
SimpleSAML_Logger::debug('SAML2.0 - IdP.SingleLogoutServiceiFrame: listofsps ' . join(',', $listofsps)); SimpleSAML_Logger::debug('SAML2.0 - IdP.SingleLogoutServiceiFrame: listofsps ' . join(',', $listofsps));
...@@ -224,7 +247,7 @@ SimpleSAML_Logger::debug('SAML2.0 - SP Counter. other SPs with SLO support (' . ...@@ -224,7 +247,7 @@ SimpleSAML_Logger::debug('SAML2.0 - SP Counter. other SPs with SLO support (' .
/* /*
* If the user is not logged into any other SPs. * If the user is not logged into any other SPs.
*/ */
if (count($sparray) === 0) { if (count($sparray) + count($sparrayNoLogout) === 0) {
SimpleSAML_Utilities::redirect($relayState); SimpleSAML_Utilities::redirect($relayState);
exit; exit;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment