ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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...
 
 __construct (\SimpleSAML_IdP $idp)
 Initialize this logout handler. More...
 
 startLogout (array &$state, $assocId)
 Start a logout operation. More...
 
 onResponse ($assocId, $relayState, \SimpleSAML_Error_Exception $error=null)
 Handles responses to our logout requests. More...
 

Private Attributes

 $idp
 

Detailed Description

Definition at line 13 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 29 of file IFrameLogoutHandler.php.

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

References SimpleSAML\IdP\IFrameLogoutHandler\$idp.

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 89 of file IFrameLogoutHandler.php.

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

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

+ 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 40 of file IFrameLogoutHandler.php.

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

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

+ 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: