ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
SimpleSAML\IdP\IFrameLogoutHandler Class Reference
+ Inheritance diagram for SimpleSAML\IdP\IFrameLogoutHandler:
+ Collaboration diagram for SimpleSAML\IdP\IFrameLogoutHandler:

Public Member Functions

 __construct (\SimpleSAML_IdP $idp)
 LogoutIFrame constructor. More...
 
 startLogout (array &$state, $assocId)
 Start the logout operation. More...
 
 onResponse ($assocId, $relayState, \SimpleSAML_Error_Exception $error=null)
 Continue the logout operation. More...
 

Private Attributes

 $idp
 

Detailed Description

Definition at line 14 of file IFrameLogoutHandler.php.

Constructor & Destructor Documentation

◆ __construct()

SimpleSAML\IdP\IFrameLogoutHandler::__construct ( \SimpleSAML_IdP  $idp)

LogoutIFrame constructor.

Parameters
\SimpleSAML_IdP$idpThe IdP to log out from.

Implements SimpleSAML\IdP\LogoutHandlerInterface.

Definition at line 30 of file IFrameLogoutHandler.php.

References SimpleSAML\IdP\IFrameLogoutHandler\$idp.

31  {
32  $this->idp = $idp;
33  }

Member Function Documentation

◆ onResponse()

SimpleSAML\IdP\IFrameLogoutHandler::onResponse (   $assocId,
  $relayState,
\SimpleSAML_Error_Exception  $error = null 
)

Continue the logout operation.

This function will never return.

Parameters
string$assocIdThe association that is terminated.
string | null$relayStateThe RelayState from the start of the logout.
\SimpleSAML_Error_Exception | null$errorThe error that occurred during session termination (if any).

Implements SimpleSAML\IdP\LogoutHandlerInterface.

Definition at line 90 of file IFrameLogoutHandler.php.

References $assocId, $error, $header, exit, html(), and s.

91  {
92  assert('is_string($assocId)');
93 
94  $spId = sha1($assocId);
95  $this->idp->terminateAssociation($assocId);
96 
97  $header = <<<HEADER
98 <!DOCTYPE html>
99 <html>
100  <head>
101  <title>Logout response from %s</title>
102  <script>
103 HEADER;
104  printf($header, htmlspecialchars(var_export($assocId, true)));
105  if ($error) {
106  $errorMsg = $error->getMessage();
107  echo('window.parent.logoutFailed("'.$spId.'", "'.addslashes($errorMsg).'");');
108  } else {
109  echo('window.parent.logoutCompleted("'.$spId.'");');
110  }
111  echo <<<FOOTER
112  </script>
113  </head>
114  <body>
115  </body>
116 </html>
117 FOOTER;
118  exit(0);
119  }
$error
Definition: Error.php:17
Add data(end) s
html()
if(!isset($_REQUEST['association'])) $assocId
+ Here is the call graph for this function:

◆ startLogout()

SimpleSAML\IdP\IFrameLogoutHandler::startLogout ( array $state,
  $assocId 
)

Start the logout operation.

Parameters
array&$stateThe logout state.
string | null$assocIdThe SP we are logging out from.

Implements SimpleSAML\IdP\LogoutHandlerInterface.

Definition at line 41 of file IFrameLogoutHandler.php.

References $association, $associations, $assocId, $id, SimpleSAML\IdP\IFrameLogoutHandler\$idp, $params, $url, array, SimpleSAML_IdP\getByState(), SimpleSAML\Module\getModuleURL(), SimpleSAML\Utils\HTTP\redirectTrustedURL(), and SimpleSAML_Auth_State\saveState().

42  {
43  assert('is_string($assocId) || is_null($assocId)');
44 
45  $associations = $this->idp->getAssociations();
46 
47  if (count($associations) === 0) {
48  $this->idp->finishLogout($state);
49  }
50 
51  foreach ($associations as $id => &$association) {
53  $association['core:Logout-IFrame:Name'] = $idp->getSPName($id);
54  $association['core:Logout-IFrame:State'] = 'onhold';
55  }
56  $state['core:Logout-IFrame:Associations'] = $associations;
57 
58  if (!is_null($assocId)) {
59  $spName = $this->idp->getSPName($assocId);
60  if ($spName === null) {
61  $spName = array('en' => $assocId);
62  }
63 
64  $state['core:Logout-IFrame:From'] = $spName;
65  } else {
66  $state['core:Logout-IFrame:From'] = null;
67  }
68 
69  $params = array(
70  'id' => \SimpleSAML_Auth_State::saveState($state, 'core:Logout-IFrame'),
71  );
72  if (isset($state['core:Logout-IFrame:InitType'])) {
73  $params['type'] = $state['core:Logout-IFrame:InitType'];
74  }
75 
76  $url = Module::getModuleURL('core/idp/logout-iframe.php', $params);
78  }
$params
Definition: disable.php:11
static getByState(array &$state)
Retrieve the IdP "owning" the state.
Definition: IdP.php:152
if(!array_key_exists('StateId', $_REQUEST)) $id
static redirectTrustedURL($url, $parameters=array())
This function redirects to the specified URL without performing any security checks.
Definition: HTTP.php:962
static getModuleURL($resource, array $parameters=array())
Get absolute URL to a specified module resource.
Definition: Module.php:303
if(!array_key_exists('stateid', $_REQUEST)) $state
Handle linkback() response from LinkedIn.
Definition: linkback.php:10
Create styles array
The data for the language used.
if(!isset($associations[$assocId])) $association
if(!isset($_REQUEST['association'])) $assocId
$url
static saveState(&$state, $stage, $rawId=false)
Save the state.
Definition: State.php:194
$associations
+ Here is the call graph for this function:

Field Documentation

◆ $idp

SimpleSAML\IdP\IFrameLogoutHandler::$idp
private

The documentation for this class was generated from the following file: