ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
SimpleSAML\IdP\TraditionalLogoutHandler Class Reference
+ Inheritance diagram for SimpleSAML\IdP\TraditionalLogoutHandler:
+ Collaboration diagram for SimpleSAML\IdP\TraditionalLogoutHandler:

Public Member Functions

 __construct (\SimpleSAML_IdP $idp)
 TraditionalLogout 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 Member Functions

 logoutNextSP (array &$state)
 Picks the next SP and issues a logout request. More...
 

Private Attributes

 $idp
 

Detailed Description

Definition at line 13 of file TraditionalLogoutHandler.php.

Constructor & Destructor Documentation

◆ __construct()

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

TraditionalLogout constructor.

Parameters
\SimpleSAML_IdP$idpThe IdP to log out from.

Implements SimpleSAML\IdP\LogoutHandlerInterface.

Definition at line 29 of file TraditionalLogoutHandler.php.

References SimpleSAML\IdP\TraditionalLogoutHandler\$idp.

Member Function Documentation

◆ logoutNextSP()

SimpleSAML\IdP\TraditionalLogoutHandler::logoutNextSP ( array &  $state)
private

Picks the next SP and issues a logout request.

This function never returns.

Parameters
array&$stateThe logout state.

Definition at line 42 of file TraditionalLogoutHandler.php.

43 {
44 $association = array_pop($state['core:LogoutTraditional:Remaining']);
45 if ($association === null) {
46 $this->idp->finishLogout($state);
47 }
48
49 $relayState = \SimpleSAML_Auth_State::saveState($state, 'core:LogoutTraditional', true);
50
51 $id = $association['id'];
52 Logger::info('Logging out of '.var_export($id, true).'.');
53
54 try {
56 $url = call_user_func(array($association['Handler'], 'getLogoutURL'), $idp, $association, $relayState);
58 } catch (\Exception $e) {
59 Logger::warning('Unable to initialize logout to '.var_export($id, true).'.');
60 $this->idp->terminateAssociation($id);
61 $state['core:Failed'] = true;
62
63 // Try the next SP
64 $this->logoutNextSP($state);
65 assert(false);
66 }
67 }
if(!array_key_exists('stateid', $_REQUEST)) $state
Handle linkback() response from LinkedIn.
Definition: linkback.php:10
logoutNextSP(array &$state)
Picks the next SP and issues a logout request.
static info($string)
Definition: Logger.php:199
static warning($string)
Definition: Logger.php:177
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
$relayState
if(!isset($associations[$assocId])) $association
$url

References $association, $id, SimpleSAML\IdP\TraditionalLogoutHandler\$idp, $relayState, $state, $url, SimpleSAML_IdP\getByState(), SimpleSAML\Logger\info(), SimpleSAML\IdP\TraditionalLogoutHandler\logoutNextSP(), SimpleSAML\Utils\HTTP\redirectTrustedURL(), SimpleSAML_Auth_State\saveState(), and SimpleSAML\Logger\warning().

Referenced by SimpleSAML\IdP\TraditionalLogoutHandler\logoutNextSP(), SimpleSAML\IdP\TraditionalLogoutHandler\onResponse(), and SimpleSAML\IdP\TraditionalLogoutHandler\startLogout().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ onResponse()

SimpleSAML\IdP\TraditionalLogoutHandler::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).
Exceptions

SimpleSAML_Error_Exception If the RelayState was lost during logout.

Implements SimpleSAML\IdP\LogoutHandlerInterface.

Definition at line 97 of file TraditionalLogoutHandler.php.

98 {
99 assert(is_string($assocId));
100 assert(is_string($relayState) || $relayState === null);
101
102 if ($relayState === null) {
103 throw new \SimpleSAML_Error_Exception('RelayState lost during logout.');
104 }
105
106 $state = \SimpleSAML_Auth_State::loadState($relayState, 'core:LogoutTraditional');
107
108 if ($error === null) {
109 Logger::info('Logged out of '.var_export($assocId, true).'.');
110 $this->idp->terminateAssociation($assocId);
111 } else {
112 Logger::warning('Error received from '.var_export($assocId, true).' during logout:');
113 $error->logWarning();
114 $state['core:Failed'] = true;
115 }
116
117 $this->logoutNextSP($state);
118 }
static loadState($id, $stage, $allowMissing=false)
Retrieve saved state.
Definition: State.php:259
if(!isset($_REQUEST['association'])) $assocId

References $assocId, $relayState, $state, SimpleSAML\Logger\info(), SimpleSAML_Auth_State\loadState(), SimpleSAML\IdP\TraditionalLogoutHandler\logoutNextSP(), and SimpleSAML\Logger\warning().

+ Here is the call graph for this function:

◆ startLogout()

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

Start the logout operation.

This function never returns.

Parameters
array&$stateThe logout state.
string$assocIdThe association that started the logout.

Implements SimpleSAML\IdP\LogoutHandlerInterface.

Definition at line 78 of file TraditionalLogoutHandler.php.

79 {
80 $state['core:LogoutTraditional:Remaining'] = $this->idp->getAssociations();
81
82 $this->logoutNextSP($state);
83 }

References $state, and SimpleSAML\IdP\TraditionalLogoutHandler\logoutNextSP().

+ Here is the call graph for this function:

Field Documentation

◆ $idp

SimpleSAML\IdP\TraditionalLogoutHandler::$idp
private

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