Skip to content

Commit 05a8315

Browse files
Add example for recursive LDAP group search
Signed-off-by: Ethan Dieterich <ethandieterich@gmail.com>
1 parent 9ac240c commit 05a8315

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

content/docs/connectors/ldap.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,3 +354,31 @@ connectors:
354354
nameAttr: cn
355355
```
356356

357+
## Example: Searching a FreeIPA server for nested groups
358+
359+
Some LDAP schemas support group nesting, where groups can contain other groups. Dex supports resolving these indirect group memberships using the `recursive` option within the `groupSearch.userMatchers` block.
360+
361+
You might want to use this if, for example, John is a member of the group `seniorAdmins`, and `seniorAdmins` is itself a member of the group `admins`. With recursive search enabled, John will be treated as a member of both `seniorAdmins` and `admins`, even though he’s only directly assigned to `seniorAdmins`.
362+
363+
The following is a `groupsearch` configuration that enables this functionality.
364+
365+
```yaml
366+
groupSearch:
367+
baseDN: cn=groups,dc=freeipa,dc=example,dc=com
368+
filter: "(objectClass=group)"
369+
userMatchers:
370+
- userAttr: uid
371+
groupAttr: member
372+
recursive: true
373+
recursionGroupAttr: member
374+
nameAttr: name
375+
```
376+
377+
In this example:
378+
379+
1. Dex looks for groups where the member attribute matches the user's `uid`.
380+
2. Groups can list other groups in their member attribute, allowing nesting.
381+
3. With `recursive: true`, Dex will look for parent groups that include the user's groups, building a complete list of direct and indirect memberships.
382+
4. `recursionGroupAttr` tells Dex which attribute to follow when tracing nested group links.
383+
384+
Dex includes built-in cycle detection to prevent infinite loops if group references form a cycle.

0 commit comments

Comments
 (0)