diff --git a/modules/core/www/idp/logout-iframe-done.php b/modules/core/www/idp/logout-iframe-done.php index 4625ca4db0bab431f89474de3cecb8977bcd3f25..7b87ecf113bdc99a7476f2506874c9691c50a96d 100644 --- a/modules/core/www/idp/logout-iframe-done.php +++ b/modules/core/www/idp/logout-iframe-done.php @@ -9,7 +9,16 @@ $state = SimpleSAML_Auth_State::loadState($id, 'core:Logout-IFrame'); $idp = SimpleSAML_IdP::getByState($state); $associations = $idp->getAssociations(); -$SPs = $state['core:Logout-IFrame:Associations']; + +if (!isset($_REQUEST['cancel'])) { + SimpleSAML_Logger::stats('slo-iframe done'); + $SPs = $state['core:Logout-IFrame:Associations']; +} else { + /* User skipped global logout. */ + SimpleSAML_Logger::stats('slo-iframe skip'); + $SPs = array(); /* No SPs should have been logged out. */ + $state['core:Failed'] = TRUE; /* Mark as partial logout. */ +} $globalConfig = SimpleSAML_Configuration::getInstance(); $cookiePath = '/' . $globalConfig->getBaseURL(); @@ -42,6 +51,12 @@ foreach ($SPs as $assocId => $sp) { $idp->terminateAssociation($assocId); } else { SimpleSAML_Logger::warning('Unable to terminate association with ' . var_export($assocId, TRUE) . '.'); + if (isset($sp['saml:entityID'])) { + $spId = $sp['saml:entityID']; + } else { + $spId = $assocId; + } + SimpleSAML_Logger::stats('slo-iframe-fail ' . $spId); $state['core:Failed'] = TRUE; } diff --git a/modules/core/www/idp/logout-iframe.php b/modules/core/www/idp/logout-iframe.php index 3cb2c2efaf22bbcb03bd641ae687c714d86112fc..4caa4b47a8304b6af8086c5333356bd0f60a21c8 100644 --- a/modules/core/www/idp/logout-iframe.php +++ b/modules/core/www/idp/logout-iframe.php @@ -20,6 +20,10 @@ if (isset($_REQUEST['timeout'])) { $timeout = time() + 10; } +if ($type !== 'embed' && $type !== 'async') { + SimpleSAML_Logger::stats('slo-iframe ' . $type); +} + $state = SimpleSAML_Auth_State::loadState($id, 'core:Logout-IFrame'); $idp = SimpleSAML_IdP::getByState($state); diff --git a/modules/statistics/config-templates/module_statistics.php b/modules/statistics/config-templates/module_statistics.php index 4ad099819848bfcf4c6b297359c08b35ad81b05a..ca0180826e755789f400b432a7656bf324771609 100644 --- a/modules/statistics/config-templates/module_statistics.php +++ b/modules/statistics/config-templates/module_statistics.php @@ -216,6 +216,22 @@ $config = array ( 'config' => 'saml20-sp-remote', ), ), + 'slopages' => array( + 'name' => 'SLO iframe pages', + 'descr' => 'The varioust IFrame SLO pages a user visits', + 'action' => 'slo-iframe', + 'col' => 6, // Page the user visits. + ), + 'slofail' => array( + 'name' => 'Failed iframe IdP-init SLOs', + 'descr' => 'The number of logout failures from various SPs', + 'action' => 'slo-iframe-fail', + 'col' => 6, // Service Provider EntityID that wasn't logged out. + 'fieldPresentation' => array( + 'class' => 'statistics:Entity', + 'config' => 'saml20-sp-remote', + ), + ), ), );