@@ -6,10 +6,10 @@ LDAP server. There are two separate authentication modules and two
66authentication processing filters:
77
88
9- ` ldap:LDAP `
9+ ` ldap:ldap `
1010: Authenticate the user against a single LDAP server.
1111
12- ` ldap:LDAPMulti `
12+ ` ldap:LdapMulti `
1313: Allow the user to chose one LDAP server to authenticate against.
1414
1515` ldap:AttributeAddFromLDAP `
@@ -26,21 +26,21 @@ server with all the users. To create an LDAP authentication source, open
2626` config/authsources.php ` in a text editor, and add an entry for the
2727authentication source:
2828
29- 'example-ldap' => array(
30- 'ldap:LDAP ',
29+ 'example-ldap' => [
30+ 'ldap:Ldap ',
3131
3232 /* The hostname of the LDAP server. */
3333 'hostname' => 'ldap.example.org',
3434
3535 /* Whether SSL/TLS should be used when contacting the LDAP server. */
36- 'enable_tls' => FALSE ,
36+ 'enable_tls' => false ,
3737
3838 /*
3939 * Which attributes should be retrieved from the LDAP server.
4040 * This can be an array of attribute names, or NULL, in which case
4141 * all attributes are fetched.
4242 */
43- 'attributes' => NULL ,
43+ 'attributes' => null ,
4444
4545 /*
4646 * The pattern which should be used to create the user's DN given the username.
@@ -54,7 +54,7 @@ authentication source:
5454 * As an alternative to specifying a pattern for the users DN, it is possible to
5555 * search for the username in a set of attributes. This is enabled by this option.
5656 */
57- 'search.enable' => FALSE ,
57+ 'search.enable' => false ,
5858
5959 /*
6060 * The DN which will be used as a base for the search.
@@ -75,7 +75,7 @@ authentication source:
7575 * This is an array with one or more attribute names. Any of the attributes in
7676 * the array may match the value the username.
7777 */
78- 'search.attributes' => array( 'uid', 'mail') ,
78+ 'search.attributes' => [ 'uid', 'mail'] ,
7979
8080 /*
8181 * Additional filters that must match for the entire LDAP search to be TRUE
@@ -89,9 +89,9 @@ authentication source:
8989 * The username & password where SimpleSAMLphp should bind to before searching. If
9090 * this is left NULL, no bind will be performed before searching.
9191 */
92- 'search.username' => NULL ,
93- 'search.password' => NULL ,
94- ) ,
92+ 'search.username' => null ,
93+ 'search.password' => null ,
94+ ] ,
9595
9696
9797You should update the name of this authentication source
@@ -148,24 +148,24 @@ In this case, if we are unable to connect to the first LDAP server within 10 sec
148148#### Example ####
149149
150150 /* Configuration that uses two ldap servers. */
151- 'example-ldap' => array(
152- 'ldap:LDAP ',
151+ 'example-ldap' => [
152+ 'ldap:Ldap ',
153153 /* The hostname of the LDAP server. */
154154 'hostname' => 'ldaps://ldap1.example.org ldaps://ldap2.example.org',
155155 'dnpattern' => 'uid=%username%,ou=people,dc=example,dc=org',
156- ) ,
156+ ] ,
157157
158158
159- ` ldap:LDAPMulti `
159+ ` ldap:LdapMulti `
160160----------------
161161
162162This module can be used if your organization has separate groups with
163163separate LDAP servers or separate LDAP configurations. To use this
164164authentication module, open ` config/authsources.php ` in a text editor,
165165and add an entry which uses this module:
166166
167- 'example-ldapmulti' => array(
168- 'ldap:LDAPMulti ',
167+ 'example-ldapmulti' => [
168+ 'ldap:LdapMulti ',
169169
170170 /*
171171 * The way the organization as part of the username should be handled.
@@ -188,7 +188,7 @@ and add an entry which uses this module:
188188 *
189189 * The default is FALSE.
190190 */
191- 'include_organization_in_username' => FALSE ,
191+ 'include_organization_in_username' => false ,
192192
193193 /*
194194 * A list of available LDAP servers.
@@ -200,7 +200,7 @@ and add an entry which uses this module:
200200 * The value of each element is an array in the same format as an LDAP
201201 * authentication source.
202202 */
203- 'employees' => array(
203+ 'employees' => [
204204 /*
205205 * A short name/description for this group. Will be shown in a dropdown list
206206 * when the user logs on.
@@ -215,16 +215,16 @@ and add an entry which uses this module:
215215 */
216216 'hostname' => 'ldap.employees.example.org',
217217 'dnpattern' => 'uid=%username%,ou=employees,dc=example,dc=org',
218- ) ,
218+ ] ,
219219
220- 'students' => array(
220+ 'students' => [
221221 'description' => 'Students',
222222
223223 'hostname' => 'ldap.students.example.org',
224224 'dnpattern' => 'uid=%username%,ou=students,dc=example,dc=org',
225- ) ,
225+ ] ,
226226
227- ) ,
227+ ] ,
228228
229229The name of the authentication source (` example-ldapmulti ` ) should be
230230changed to something that makes sense for your organization. Each entry
@@ -235,12 +235,12 @@ and will be shown to the user in a dropdown list on the login page.
235235The ` description ` -option can also be an array with descriptions in
236236different languages:
237237
238- 'description' => array(
238+ 'description' => [
239239 'en' => 'Employees',
240240 'no' => 'Ansatte',
241- ) ,
241+ ] ,
242242
243- All options from the ` ldap:LDAP ` configuration can be used in each
243+ All options from the ` ldap:Ldap ` configuration can be used in each
244244group, and you should refer to the documentation for that module for
245245more information about available options.
246246
@@ -254,7 +254,7 @@ in the ldap:AttributeAddUsersGroups filter (below), these are the filter
254254specific configuration options:
255255
256256
257- 50 = array(
257+ 50 = [
258258 'class' => 'ldap:AttributeAddFromLDAP',
259259
260260 /**
@@ -265,7 +265,7 @@ specific configuration options:
265265 * Default: NULL
266266 * Required: Yes
267267 */
268- 'attributes' => array( 'mail', 'jpegPhoto' => 'jpegphoto') ,
268+ 'attributes' => [ 'mail', 'jpegPhoto' => 'jpegphoto'] ,
269269
270270 /**
271271 * The attribute policy that defines what to do with attributes that are
@@ -297,7 +297,7 @@ specific configuration options:
297297 * Required: Yes
298298 */
299299 'search.filter' => '(uid=%uid%)',
300- ) ;
300+ ] ;
301301
302302
303303### Backwards Compatibility ###
@@ -315,26 +315,26 @@ This is the most basic configuration possible. It will look at the
315315authsource for all LDAP connection information and queries LDAP for
316316the specific attributes requested.
317317
318- 50 => array(
318+ 50 => [
319319 'class' => 'ldap:AttributeAddFromLDAP',
320320 'authsource' => 'example-ldap',
321- 'attributes' => array( 'displayName' => 'cn', 'jpegPhoto') ,
321+ 'attributes' => [ 'displayName' => 'cn', 'jpegPhoto'] ,
322322 'search.filter' => '(uid=%uid%)',
323- )
323+ ]
324324
325325If no authsource is available then you can specify the connection info
326326using the filter configuration. Note: Not all of the options below are
327327required, see the config options for ldap: AttributeAddFromLDAP above.
328328
329- 50 => array(
329+ 50 => [
330330 'class' => 'ldap:AttributeAddFromLDAP',
331331 'ldap.hostname' => 'ldap.example.org',
332332 'ldap.username' => 'CN=LDAP User,CN=Users,DC=example,DC=org',
333333 'ldap.password' => 'Abc123',
334334 'ldap.basedn' => 'DC=example,DC=org',
335- 'attributes' => array( 'displayName' => 'cn', 'jpegPhoto') ,
335+ 'attributes' => [ 'displayName' => 'cn', 'jpegPhoto'] ,
336336 'search.filter' => '(uid=%uid%)',
337- )
337+ ]
338338
339339
340340
@@ -351,7 +351,7 @@ a member of. This can be helpful for other filters to know. Below is
351351a listing of all configuration options and their details.
352352
353353
354- 50 => array(
354+ 50 => [
355355 'class' => 'ldap:AttributeAddUsersGroups',
356356
357357
@@ -367,7 +367,7 @@ a listing of all configuration options and their details.
367367 * Default: NULL
368368 * Require: No
369369 */
370- 'authsource' => NULL ,
370+ 'authsource' => null ,
371371 'authsource' => 'example-ldap',
372372
373373
@@ -394,10 +394,10 @@ a listing of all configuration options and their details.
394394 */
395395 'ldap.basedn' => '',
396396 'ldap.basedn' => 'DC=example,DC=org',
397- 'ldap.basedn' => array(
397+ 'ldap.basedn' => [
398398 'OU=Staff,DC=example,DC=org',
399399 'OU=Students,DC=example,DC=org'
400- ) ,
400+ ] ,
401401
402402
403403 /**
@@ -408,8 +408,8 @@ a listing of all configuration options and their details.
408408 * Required: No
409409 * AuthSource: debug
410410 */
411- 'ldap.debug' => FALSE ,
412- 'ldap.debug' => TRUE ,
411+ 'ldap.debug' => false ,
412+ 'ldap.debug' => true ,
413413
414414
415415 /**
@@ -422,8 +422,8 @@ a listing of all configuration options and their details.
422422 * Required: No
423423 * AuthSource: enable_tls
424424 */
425- 'ldap.enable_tls' => FALSE ,
426- 'ldap.enable_tls' => TRUE ,
425+ 'ldap.enable_tls' => false ,
426+ 'ldap.enable_tls' => true ,
427427
428428
429429 /**
@@ -532,7 +532,7 @@ a listing of all configuration options and their details.
532532 */
533533 'type.group' => 'group',
534534 'type.user' => 'user',
535- )
535+ ]
536536
537537
538538### Example ###
@@ -541,41 +541,41 @@ This is the most basic configuration possible. It will look at the
541541authsource for all LDAP connection information and manually search
542542the hierarchy for the users group memberships.
543543
544- 50 => array(
544+ 50 => [
545545 'class' => 'ldap:AttributeAddUsersGroups',
546546 'authsource' => 'example-ldap'
547- )
547+ ]
548548
549549By making one small change we can optimize the filter to use better
550550group search methods and eliminate un-needed LDAP queries.
551551
552- 50 => array(
552+ 50 => [
553553 'class' => 'ldap:AttributeAddUsersGroups',
554554 'authsource' => 'example-ldap',
555555 'ldap.product' => 'ActiveDirectory'
556- )
556+ ]
557557
558558If no authsource is available then you can specify the connection info
559559using the filter configuration. Note: Not all of the options below are
560560required, see the config info above for details.
561561
562- 50 => array(
562+ 50 => [
563563 'class' => 'ldap:AttributeAddUsersGroups',
564564 'ldap.hostname' => 'ldap.example.org',
565565 'ldap.username' => 'CN=LDAP User,CN=Users,DC=example,DC=org',
566566 'ldap.password' => 'Abc123',
567567 'ldap.basedn' => 'DC=example,DC=org'
568- )
568+ ]
569569
570570Example for unsupported OpenLDAP usage.
571571Intention is to filter in ` ou=groups,dc=example,dc=com ` for
572572` (memberUid = <UID>) ` and take only the attribute ` cn ` (=name of the group).
573573
574- 50 => array(
574+ 50 => [
575575 'class' => 'ldap:AttributeAddUsersGroups',
576576 'ldap.product' => 'OpenLDAP',
577577 'ldap.basedn' => 'ou=groups,dc=example,dc=org',
578578 'attribute.username' => 'uid',
579579 'attribute.member' => 'cn',
580580 'attribute.memberof' => 'memberUid',
581- ) ,
581+ ] ,
0 commit comments