Skip to content
Snippets Groups Projects
Commit e7188f86 authored by Jaime Pérez Crespo's avatar Jaime Pérez Crespo
Browse files

Minor fixes for iframe logout.

- Make sure timeout is added conditionally, when we actually have it.
- Additionally, pass the state ID to the template in the "auth_state" variable. Trying to be consistent with this from now on.
parent 74a954b4
No related branches found
No related tags found
No related merge requests found
<?php <?php
$id = $this->data['id']; $id = $this->data['auth_state'];
$SPs = $this->data['SPs']; $SPs = $this->data['SPs'];
$iframeURL = 'logout-iframe.php?type=embed&id='.urlencode($id); $iframeURL = 'logout-iframe.php?type=embed&id='.urlencode($id);
......
<?php <?php
$id = $this->data['id']; $id = $this->data['auth_state'];
$type = $this->data['type']; $type = $this->data['type'];
$from = $this->data['from']; $from = $this->data['from'];
$SPs = $this->data['SPs']; $SPs = $this->data['SPs'];
......
...@@ -39,7 +39,7 @@ if ($type !== 'init') { // update association state ...@@ -39,7 +39,7 @@ if ($type !== 'init') { // update association state
} }
} }
// heck for timeout // check for timeout
if (isset($sp['core:Logout-IFrame:Timeout']) && $sp['core:Logout-IFrame:Timeout'] < time()) { if (isset($sp['core:Logout-IFrame:Timeout']) && $sp['core:Logout-IFrame:Timeout'] < time()) {
if ($sp['core:Logout-IFrame:State'] === 'inprogress') { if ($sp['core:Logout-IFrame:State'] === 'inprogress') {
$sp['core:Logout-IFrame:State'] = 'failed'; $sp['core:Logout-IFrame:State'] = 'failed';
...@@ -104,10 +104,12 @@ foreach ($state['core:Logout-IFrame:Associations'] as $association) { ...@@ -104,10 +104,12 @@ foreach ($state['core:Logout-IFrame:Associations'] as $association) {
'entityID' => $association['saml:entityID'], 'entityID' => $association['saml:entityID'],
'subject' => $association['saml:NameID'], 'subject' => $association['saml:NameID'],
'status' => $association['core:Logout-IFrame:State'], 'status' => $association['core:Logout-IFrame:State'],
'timeout' => $association['core:Logout-IFrame:Timeout'],
'logoutURL' => $association['core:Logout-IFrame:URL'], 'logoutURL' => $association['core:Logout-IFrame:URL'],
'metadata' => $mdh->getMetaDataConfig($association['saml:entityID'], $mdset)->toArray(), 'metadata' => $mdh->getMetaDataConfig($association['saml:entityID'], $mdset)->toArray(),
); );
if (isset($association['core:Logout-IFrame:Timeout'])) {
$remaining[$key]['timeout'] = $association['core:Logout-IFrame:Timeout'];
}
} }
$id = SimpleSAML_Auth_State::saveState($state, 'core:Logout-IFrame'); $id = SimpleSAML_Auth_State::saveState($state, 'core:Logout-IFrame');
...@@ -119,6 +121,10 @@ if ($type === 'nojs') { ...@@ -119,6 +121,10 @@ if ($type === 'nojs') {
} }
$t = new SimpleSAML_XHTML_Template($globalConfig, $template_id); $t = new SimpleSAML_XHTML_Template($globalConfig, $template_id);
$t->data['auth_state'] = $id;
/**
* @deprecated The "id" variable will be removed. Please use "auth_state" instead.
*/
$t->data['id'] = $id; $t->data['id'] = $id;
$t->data['type'] = $type; $t->data['type'] = $type;
$t->data['terminated_service'] = $terminated; $t->data['terminated_service'] = $terminated;
......
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