ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 14 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 30 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 43 of file TraditionalLogoutHandler.php.

44 {
45 $association = array_pop($state['core:LogoutTraditional:Remaining']);
46 if ($association === null) {
47 $this->idp->finishLogout($state);
48 }
49
50 $relayState = \SimpleSAML_Auth_State::saveState($state, 'core:LogoutTraditional', true);
51
52 $id = $association['id'];
53 Logger::info('Logging out of '.var_export($id, true).'.');
54
55 try {
57 $url = call_user_func(array($association['Handler'], 'getLogoutURL'), $idp, $association, $relayState);
59 } catch (\Exception $e) {
60 Logger::warning('Unable to initialize logout to '.var_export($id, true).'.');
61 $this->idp->terminateAssociation($id);
62 $state['core:Failed'] = true;
63
64 // Try the next SP
65 $this->logoutNextSP($state);
66 assert('FALSE');
67 }
68 }
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:201
static warning($string)
Definition: Logger.php:179
static redirectTrustedURL($url, $parameters=array())
This function redirects to the specified URL without performing any security checks.
Definition: HTTP.php:962
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:152
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 98 of file TraditionalLogoutHandler.php.

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

References $assocId, $error, $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 79 of file TraditionalLogoutHandler.php.

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

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: