17 if ($store->getTableVersion(
'saml_PersistentNameID') === 1) {
21 $query =
'CREATE TABLE ' . $store->prefix .
'_saml_PersistentNameID ( 22 _idp VARCHAR(256) NOT NULL, 23 _sp VARCHAR(256) NOT NULL, 24 _user VARCHAR(256) NOT NULL, 25 _value VARCHAR(40) NOT NULL, 26 UNIQUE (_idp, _sp, _user) 30 $query =
'CREATE INDEX ' . $store->prefix .
'_saml_PersistentNameID_idp_sp ON ' . $store->prefix .
'_saml_PersistentNameID (_idp, _sp)';
33 $store->setTableVersion(
'saml_PersistentNameID', 1);
70 assert(is_string(
$user));
71 assert(is_string($value));
82 $query =
'INSERT INTO ' .
$store->prefix .
'_saml_PersistentNameID (_idp, _sp, _user, _value) VALUES(:_idp, :_sp, :_user, :_value)';
99 assert(is_string($spEntityId));
100 assert(is_string(
$user));
102 $store = self::getStore();
106 '_sp' => $spEntityId,
110 $query =
'SELECT _value FROM ' .
$store->prefix .
'_saml_PersistentNameID WHERE _idp = :_idp AND _sp = :_sp AND _user = :_user';
115 if (
$row ===
false) {
120 return $row[
'_value'];
134 assert(is_string($spEntityId));
135 assert(is_string(
$user));
137 $store = self::getStore();
141 '_sp' => $spEntityId,
145 $query =
'DELETE FROM ' .
$store->prefix .
'_saml_PersistentNameID WHERE _idp = :_idp AND _sp = :_sp AND _user = :_user';
161 assert(is_string($spEntityId));
163 $store = self::getStore();
167 '_sp' => $spEntityId,
170 $query =
'SELECT _user, _value FROM ' .
$store->prefix .
'_saml_PersistentNameID WHERE _idp = :_idp AND _sp = :_sp';
175 while ((
$row =
$query->fetch(PDO::FETCH_ASSOC)) !==
false) {
176 $res[
$row[
'_user']] = $row[
'_value'];
static getStore()
Retrieve the SQL datastore.
static add($idpEntityId, $spEntityId, $user, $value)
Add a NameID into the database.
static getIdentities($idpEntityId, $spEntityId)
Retrieve all federated identities for an IdP-SP pair.
if(! $oauthconfig->getBoolean('getUserInfo.enable', FALSE)) $store
Attribute-related utility methods.
foreach($_POST as $key=> $value) $res
static createTable(\SimpleSAML\Store\SQL $store)
Create NameID table in SQL, if it is missing.
static getInstance()
Retrieve our singleton instance.