When "attributes" of ldap configuration is set to NULL, this module is supposed to provide all the ldap attributes to SP.
However, it returns NO ldap attributes under the circumstance right now.
Why?
I found evaluation of "attributes" configuration in src/Auth/Source/Ldap.php.
Here is what the process is doing when "attributes" is set to NULL
Try to get "attributes" configuration by using getOptionalValue
getOptionalValue func returns the default value supplied which is $this->ldapConfig->hasValue('attributes') ? null: [] because "attributes" is NULL.
$this->ldapConfig->hasValue func returns false cause its implementation is return array_key_exists($name, $this->configuration) && !is_null($this->configuration[$name]);. (refer to simplesamlphp/simplesamlphp:src/SimpleSAML/Configuration.php)
Therefore $attributes is set to empty array.
$attributes === null ends up to false even though original configuration value is NULL. And no ldap attributes are returned.
Solution
Here is a brief solution:
private function processAttributes(Entry $entry): array
{
$attributes = $this->ldapConfig->getOptionalValue(
'attributes',
// If specifically set to NULL return all attributes, if not set at all return nothing (safe default)
// $this->ldapConfig->hasValue('attributes') ? null: [],
in_array('attributes', $this->ldapConfig->getOptions()) ? null: [],
);
[...]
When "attributes" of ldap configuration is set to NULL, this module is supposed to provide all the ldap attributes to SP. However, it returns NO ldap attributes under the circumstance right now.
Why?
I found evaluation of "attributes" configuration in src/Auth/Source/Ldap.php. Here is what the process is doing when "attributes" is set to NULL
$this->ldapConfig->hasValue('attributes') ? null: []
because "attributes" is NULL.return array_key_exists($name, $this->configuration) && !is_null($this->configuration[$name]);
. (refer to simplesamlphp/simplesamlphp:src/SimpleSAML/Configuration.php)$attributes === null
ends up to false even though original configuration value is NULL. And no ldap attributes are returned.Solution
Here is a brief solution:
My environment