Definition at line 9 of file SQLPersistentNameID.php.
◆ __construct()
sspmod_saml_Auth_Process_SQLPersistentNameID::__construct |
( |
|
$config, |
|
|
|
$reserved |
|
) |
| |
Initialize this filter, parse configuration.
- Parameters
-
array | $config | Configuration information about this filter. |
mixed | $reserved | For future use. |
- Exceptions
-
Definition at line 49 of file SQLPersistentNameID.php.
References $config, and SAML2\Constants\NAMEID_PERSISTENT.
51 parent::__construct(
$config, $reserved);
56 if (!isset(
$config[
'attribute'])) {
59 $this->attribute =
$config[
'attribute'];
61 if (isset(
$config[
'allowUnspecified'])) {
62 $this->allowUnspecified = (bool)
$config[
'allowUnspecified'];
65 if (isset(
$config[
'allowDifferent'])) {
66 $this->allowDifferent = (bool)
$config[
'allowDifferent'];
69 if (isset(
$config[
'alwaysCreate'])) {
70 $this->alwaysCreate = (bool)
$config[
'alwaysCreate'];
const NAMEID_PERSISTENT
Persistent NameID format.
◆ getValue()
sspmod_saml_Auth_Process_SQLPersistentNameID::getValue |
( |
array & |
$state | ) |
|
|
protected |
Get the NameID value.
- Parameters
-
array | $state | The state array. |
- Returns
- string|null The NameID value.
- Exceptions
-
Definition at line 83 of file SQLPersistentNameID.php.
References $idpEntityId, $spEntityId, sspmod_saml_IdP_SQLNameID\add(), SimpleSAML\Logger\debug(), sspmod_saml_IdP_SQLNameID\get(), and SimpleSAML\Logger\warning().
86 if (!isset(
$state[
'saml:NameIDFormat']) && !$this->allowUnspecified) {
88 'SQLPersistentNameID: Request did not specify persistent NameID format, '.
89 'not generating persistent NameID.' 94 $validNameIdFormats = @array_filter(array(
95 $state[
'saml:NameIDFormat'],
96 $state[
'SPMetadata'][
'NameIDPolicy'],
97 $state[
'SPMetadata'][
'NameIDFormat']
99 if (count($validNameIdFormats) && !in_array($this->format, $validNameIdFormats,
true) &&
100 !$this->allowDifferent
103 'SQLPersistentNameID: SP expects different NameID format ('.
104 implode(
', ', $validNameIdFormats).
'), not generating persistent NameID.' 109 if (!isset(
$state[
'Destination'][
'entityid'])) {
115 if (!isset(
$state[
'Source'][
'entityid'])) {
121 if (!isset(
$state[
'Attributes'][$this->attribute]) || count(
$state[
'Attributes'][$this->attribute]) === 0) {
123 'SQLPersistentNameID: Missing attribute '.var_export($this->attribute,
true).
124 ' on user - not generating persistent NameID.' 128 if (count(
$state[
'Attributes'][$this->attribute]) > 1) {
130 'SQLPersistentNameID: More than one value in attribute '.var_export($this->attribute,
true).
131 ' on user - not generating persistent NameID.' 135 $uid = array_values(
$state[
'Attributes'][$this->attribute]);
140 'Empty value in attribute '.var_export($this->attribute,
true).
141 ' on user - not generating persistent NameID.' 147 if ($value !== null) {
149 'SQLPersistentNameID: Found persistent NameID '.var_export($value,
true).
' for user '.
150 var_export($uid,
true).
'.' 155 if ((!isset(
$state[
'saml:AllowCreate']) || !
$state[
'saml:AllowCreate']) && !$this->alwaysCreate) {
157 'SQLPersistentNameID: Did not find persistent NameID for user, and not allowed to create new NameID.' 160 \
SAML2\Constants::STATUS_RESPONDER,
161 'urn:oasis:names:tc:SAML:2.0:status:InvalidNameIDPolicy' 165 $value = bin2hex(openssl_random_pseudo_bytes(20));
167 'SQLPersistentNameID: Created persistent NameID '.var_export($value,
true).
' for user '.
168 var_export($uid,
true).
'.' static get($idpEntityId, $spEntityId, $user)
Retrieve a NameID into from database.
static add($idpEntityId, $spEntityId, $user, $value)
Add a NameID into the database.
if(!array_key_exists('stateid', $_REQUEST)) $state
Handle linkback() response from LinkedIn.
◆ $allowDifferent
sspmod_saml_Auth_Process_SQLPersistentNameID::$allowDifferent = false |
|
private |
◆ $allowUnspecified
sspmod_saml_Auth_Process_SQLPersistentNameID::$allowUnspecified = false |
|
private |
◆ $alwaysCreate
sspmod_saml_Auth_Process_SQLPersistentNameID::$alwaysCreate = false |
|
private |
◆ $attribute
sspmod_saml_Auth_Process_SQLPersistentNameID::$attribute |
|
private |
The documentation for this class was generated from the following file: