|
static | addSession ($authId, $nameId, $sessionIndex, $expire) |
| Register a new session in the datastore. More...
|
|
|
static | createLogoutTable (\SimpleSAML\Store\SQL $store) |
| Create logout table in SQL, if it is missing. More...
|
|
static | cleanLogoutStore (\SimpleSAML\Store\SQL $store) |
| Clean the logout table of expired entries. More...
|
|
static | addSessionSQL (\SimpleSAML\Store\SQL $store, $authId, $nameId, $sessionIndex, $expire, $sessionId) |
| Register a session in the SQL datastore. More...
|
|
static | getSessionsSQL (\SimpleSAML\Store\SQL $store, $authId, $nameId) |
| Retrieve sessions from the SQL datastore. More...
|
|
static | getSessionsStore (\SimpleSAML\Store $store, $authId, $nameId, array $sessionIndexes) |
| Retrieve all session IDs from a key-value store. More...
|
|
Definition at line 8 of file LogoutStore.php.
◆ addSession()
static sspmod_saml_SP_LogoutStore::addSession |
( |
|
$authId, |
|
|
|
$nameId, |
|
|
|
$sessionIndex, |
|
|
|
$expire |
|
) |
| |
|
static |
Register a new session in the datastore.
Please observe the change of the signature in this method. Previously, the second parameter ($nameId) was forced to be an array. However, it has no type restriction now, and the documentation states it must be a object. Currently, this function still accepts an array passed as $nameId, and will silently convert it to a object. This is done to keep backwards-compatibility, though will no longer be possible in the future as the $nameId parameter will be required to be an object.
- Parameters
-
string | $authId | The authsource ID. |
\SAML2\XML\saml\NameID | $nameId | The NameID of the user. |
string | NULL | $sessionIndex | The SessionIndex of the user. |
Definition at line 177 of file LogoutStore.php.
References $expire, $nameId, $session, $sessionIndex, $store, array, SAML2\XML\saml\NameIDType\fromArray(), SimpleSAML\Utils\Random\generateID(), SimpleSAML\Store\getInstance(), SimpleSAML_Session\getSession(), SimpleSAML_Session\getSessionFromRequest(), SimpleSAML\SessionHandler\getSessionHandler(), and SimpleSAML\Logger\info().
178 assert(
'is_string($authId)');
179 assert(
'is_string($sessionIndex) || is_null($sessionIndex)');
180 assert(
'is_int($expire)');
202 $strNameId = serialize(
$nameId);
203 $strNameId = sha1($strNameId);
211 $sessionId =
$session->getSessionId();
static generateID()
Generate a random identifier, ID_LENGTH bytes long.
if(! $oauthconfig->getBoolean('getUserInfo.enable', FALSE)) $store
Attribute-related utility methods.
static getInstance()
Retrieve our singleton instance.
static getSessionFromRequest()
Retrieves the current session.
static fromArray(array $nameId)
Create a object from an array with its contents.
◆ addSessionSQL()
static sspmod_saml_SP_LogoutStore::addSessionSQL |
( |
\SimpleSAML\Store\SQL |
$store, |
|
|
|
$authId, |
|
|
|
$nameId, |
|
|
|
$sessionIndex, |
|
|
|
$expire, |
|
|
|
$sessionId |
|
) |
| |
|
staticprivate |
Register a session in the SQL datastore.
- Parameters
-
\SimpleSAML\Store\SQL | $store | The datastore. |
string | $authId | The authsource ID. |
string | $nameId | The hash of the users NameID. |
string | $sessionIndex | The SessionIndex of the user. |
Definition at line 78 of file LogoutStore.php.
References $data, $expire, $nameId, $sessionIndex, and array.
79 assert(
'is_string($authId)');
80 assert(
'is_string($nameId)');
81 assert(
'is_string($sessionIndex)');
82 assert(
'is_string($sessionId)');
83 assert(
'is_int($expire)');
85 self::createLogoutTable(
$store);
87 if (rand(0, 1000) < 10) {
88 self::cleanLogoutStore(
$store);
92 '_authSource' => $authId,
95 '_expire' => gmdate(
'Y-m-d H:i:s',
$expire),
96 '_sessionId' => $sessionId,
98 $store->insertOrUpdate(
$store->prefix .
'_saml_LogoutStore',
array(
'_authSource',
'_nameId',
'_sessionIndex'),
$data);
if(! $oauthconfig->getBoolean('getUserInfo.enable', FALSE)) $store
Create styles array
The data for the language used.
◆ cleanLogoutStore()
Clean the logout table of expired entries.
- Parameters
-
\SimpleSAML\Store\SQL | $store | The datastore. |
Definition at line 58 of file LogoutStore.php.
References $params, $query, array, and SimpleSAML\Logger\debug().
62 $query =
'DELETE FROM ' .
$store->prefix .
'_saml_LogoutStore WHERE _expire < :now';
if(! $oauthconfig->getBoolean('getUserInfo.enable', FALSE)) $store
Create styles array
The data for the language used.
◆ createLogoutTable()
Create logout table in SQL, if it is missing.
- Parameters
-
\SimpleSAML\Store\SQL | $store | The datastore. |
Definition at line 15 of file LogoutStore.php.
References $query, $ret, and SimpleSAML\Logger\warning().
17 $tableVer =
$store->getTableVersion(
'saml_LogoutStore');
18 if ($tableVer === 2) {
20 } elseif ($tableVer === 1) {
22 $query =
'ALTER TABLE ' .
$store->prefix .
'_saml_LogoutStore MODIFY _authSource VARCHAR(255) NOT NULL';
29 $store->setTableVersion(
'saml_LogoutStore', 2);
33 $query =
'CREATE TABLE ' .
$store->prefix .
'_saml_LogoutStore ( 34 _authSource VARCHAR(255) NOT NULL, 35 _nameId VARCHAR(40) NOT NULL, 36 _sessionIndex VARCHAR(50) NOT NULL, 37 _expire TIMESTAMP NOT NULL, 38 _sessionId VARCHAR(50) NOT NULL, 39 UNIQUE (_authSource, _nameID, _sessionIndex) 43 $query =
'CREATE INDEX ' .
$store->prefix .
'_saml_LogoutStore_expire ON ' .
$store->prefix .
'_saml_LogoutStore (_expire)';
46 $query =
'CREATE INDEX ' .
$store->prefix .
'_saml_LogoutStore_nameId ON ' .
$store->prefix .
'_saml_LogoutStore (_authSource, _nameId)';
49 $store->setTableVersion(
'saml_LogoutStore', 2);
if(! $oauthconfig->getBoolean('getUserInfo.enable', FALSE)) $store
◆ getSessionsSQL()
static sspmod_saml_SP_LogoutStore::getSessionsSQL |
( |
\SimpleSAML\Store\SQL |
$store, |
|
|
|
$authId, |
|
|
|
$nameId |
|
) |
| |
|
staticprivate |
Retrieve sessions from the SQL datastore.
- Parameters
-
\SimpleSAML\Store\SQL | $store | The datastore. |
string | $authId | The authsource ID. |
string | $nameId | The hash of the users NameID. |
- Returns
- array Associative array of SessionIndex => SessionId.
Definition at line 110 of file LogoutStore.php.
References $nameId, $params, $query, $res, $row, and array.
111 assert(
'is_string($authId)');
112 assert(
'is_string($nameId)');
114 self::createLogoutTable(
$store);
117 '_authSource' => $authId,
119 'now' => gmdate(
'Y-m-d H:i:s'),
123 $query =
'SELECT _sessionIndex AS _sessionindex, _sessionId AS _sessionid FROM ' .
$store->prefix .
'_saml_LogoutStore' .
124 ' WHERE _authSource = :_authSource AND _nameId = :_nameId AND _expire >= :now';
129 while ( (
$row =
$query->fetch(PDO::FETCH_ASSOC)) !== FALSE) {
130 $res[
$row[
'_sessionindex']] = $row[
'_sessionid'];
if(! $oauthconfig->getBoolean('getUserInfo.enable', FALSE)) $store
foreach($_POST as $key=> $value) $res
Create styles array
The data for the language used.
◆ getSessionsStore()
static sspmod_saml_SP_LogoutStore::getSessionsStore |
( |
\SimpleSAML\Store |
$store, |
|
|
|
$authId, |
|
|
|
$nameId, |
|
|
array |
$sessionIndexes |
|
) |
| |
|
staticprivate |
Retrieve all session IDs from a key-value store.
- Parameters
-
\SimpleSAML\Store | $store | The datastore. |
string | $authId | The authsource ID. |
string | $nameId | The hash of the users NameID. |
array | $sessionIndexes | The session indexes. |
- Returns
- array Associative array of SessionIndex => SessionId.
Definition at line 146 of file LogoutStore.php.
References $nameId, $res, $sessionIndex, and array.
147 assert(
'is_string($authId)');
148 assert(
'is_string($nameId)');
152 $sessionId =
$store->get(
'saml.LogoutStore',
$nameId .
':' . $sessionIndex);
153 if ($sessionId === NULL) {
156 assert(
'is_string($sessionId)');
if(! $oauthconfig->getBoolean('getUserInfo.enable', FALSE)) $store
foreach($_POST as $key=> $value) $res
Create styles array
The data for the language used.
The documentation for this class was generated from the following file:
- libs/composer/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/SP/LogoutStore.php