@@ -204,8 +204,8 @@ public function __construct(array &$config, $reserved)
204204 $ this ->config = \SimpleSAML \Configuration::loadFromArray ($ config , 'ldap:AuthProcess ' );
205205
206206 // Set all the filter values, setting defaults if needed
207- $ this ->base_dn = $ this ->config ->getArrayizeString ('ldap.basedn ' , '' );
208- $ this ->product = $ this ->config ->getString ('ldap.product ' , '' );
207+ $ this ->base_dn = $ this ->config ->getOptionalArrayizeString ('ldap.basedn ' , '' );
208+ $ this ->product = $ this ->config ->getOptionalString ('ldap.product ' , '' );
209209
210210 // Cleanup the directory service, so that it is easier for
211211 // child classes to determine service name consistently
@@ -221,14 +221,14 @@ public function __construct(array &$config, $reserved)
221221
222222 // Setup the attribute map which will be used to search LDAP
223223 $ this ->attribute_map = [
224- 'dn ' => $ this ->config ->getString ('attribute.dn ' , 'distinguishedName ' ),
225- 'groups ' => $ this ->config ->getString ('attribute.groups ' , 'groups ' ),
226- 'member ' => $ this ->config ->getString ('attribute.member ' , 'member ' ),
227- 'memberof ' => $ this ->config ->getString ('attribute.memberof ' , 'memberOf ' ),
228- 'name ' => $ this ->config ->getString ('attribute.groupname ' , 'name ' ),
229- 'return ' => $ this ->config ->getString ('attribute.return ' , 'distinguishedName ' ),
230- 'type ' => $ this ->config ->getString ('attribute.type ' , 'objectClass ' ),
231- 'username ' => $ this ->config ->getString ('attribute.username ' , 'sAMAccountName ' )
224+ 'dn ' => $ this ->config ->getOptionalString ('attribute.dn ' , 'distinguishedName ' ),
225+ 'groups ' => $ this ->config ->getOptionalString ('attribute.groups ' , 'groups ' ),
226+ 'member ' => $ this ->config ->getOptionalString ('attribute.member ' , 'member ' ),
227+ 'memberof ' => $ this ->config ->getOptionalString ('attribute.memberof ' , 'memberOf ' ),
228+ 'name ' => $ this ->config ->getOptionalString ('attribute.groupname ' , 'name ' ),
229+ 'return ' => $ this ->config ->getOptionalString ('attribute.return ' , 'distinguishedName ' ),
230+ 'type ' => $ this ->config ->getOptionalString ('attribute.type ' , 'objectClass ' ),
231+ 'username ' => $ this ->config ->getOptionalString ('attribute.username ' , 'sAMAccountName ' )
232232 ];
233233
234234 // Log the attribute map
@@ -238,8 +238,8 @@ public function __construct(array &$config, $reserved)
238238
239239 // Setup the object type map which is used to determine a DNs' type
240240 $ this ->type_map = [
241- 'group ' => $ this ->config ->getString ('type.group ' , 'group ' ),
242- 'user ' => $ this ->config ->getString ('type.user ' , 'user ' )
241+ 'group ' => $ this ->config ->getOptionalString ('type.group ' , 'group ' ),
242+ 'user ' => $ this ->config ->getOptionalString ('type.user ' , 'user ' )
243243 ];
244244
245245 // Log the type map
@@ -265,13 +265,13 @@ protected function getLdap(): Ldap
265265
266266 // Get the connection specific options
267267 $ hostname = $ this ->config ->getString ('ldap.hostname ' );
268- $ port = $ this ->config ->getInteger ('ldap.port ' , 389 );
269- $ enable_tls = $ this ->config ->getBoolean ('ldap.enable_tls ' , false );
270- $ debug = $ this ->config ->getBoolean ('ldap.debug ' , false );
271- $ referrals = $ this ->config ->getBoolean ('ldap.referrals ' , true );
272- $ timeout = $ this ->config ->getInteger ('ldap.timeout ' , 0 );
273- $ username = $ this ->config ->getString ('ldap.username ' , null );
274- $ password = $ this ->config ->getString ('ldap.password ' , null );
268+ $ port = $ this ->config ->getOptionalInteger ('ldap.port ' , 389 );
269+ $ enable_tls = $ this ->config ->getOptionalBoolean ('ldap.enable_tls ' , false );
270+ $ debug = $ this ->config ->getOptionalBoolean ('ldap.debug ' , false );
271+ $ referrals = $ this ->config ->getOptionalBoolean ('ldap.referrals ' , true );
272+ $ timeout = $ this ->config ->getOptionalInteger ('ldap.timeout ' , 0 );
273+ $ username = $ this ->config ->getOptionalString ('ldap.username ' , null );
274+ $ password = $ this ->config ->getOptionalString ('ldap.password ' , null );
275275
276276 // Log the LDAP connection
277277 \SimpleSAML \Logger::debug (
0 commit comments