Skip to content

Commit 45ebcad

Browse files
committed
minor #20651 [Security] Add role_fetcher option to LDAP security configuration (Spomky)
This PR was merged into the 7.3 branch. Discussion ---------- [Security] Add `role_fetcher` option to LDAP security configuration Fix #20640 The `role_fetcher` option allows defining a service to fetch user roles from the LDAP server by implementing `RoleFetcherInterface`. This option was introduced in Symfony 7.3, and it supersedes `default_roles` when set. The `MemberOfRoles` implementation can be used to retrieve roles from the `ismemberof` attribute. <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/releases for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `7.x` for features of unreleased versions). --> Commits ------- 37e2349 Add `role_fetcher` option to LDAP security configuration
2 parents 08a3431 + 37e2349 commit 45ebcad

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

security/ldap.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,23 @@ This is the default role you wish to give to a user fetched from the LDAP
256256
server. If you do not configure this key, your users won't have any roles,
257257
and will not be considered as authenticated fully.
258258

259+
role_fetcher
260+
............
261+
262+
**type**: ``string`` **default**: ``null``
263+
264+
When your LDAP service provides user roles, you can use this configuration option
265+
to define the role fetcher service. The role fetcher service must implement the
266+
``Component\Ldap\Security\RoleFetcherInterface`` interface.
267+
``default_roles`` is ignored when ``role_fetcher`` is set.
268+
269+
``Symfony\Component\Ldap\Security\MemberOfRoles`` is a concrete implementation
270+
of the ``RoleFetcherInterface`` that fetches roles from the ``ismemberof`` attribute.
271+
272+
.. versionadded:: 7.3
273+
274+
The configuration option ``role_fetcher`` was introduced in Symfony 7.3.
275+
259276
uid_key
260277
.......
261278

0 commit comments

Comments
 (0)