Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc62c8f8

Browse files
author
nietonfir
committed
Explain the query_string ldap authentication provider configuration keys
Refssymfony/symfony#21402
1 parentee31b7f commitc62c8f8

File tree

2 files changed

+31
-5
lines changed

2 files changed

+31
-5
lines changed

‎reference/configuration/security.rst‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,10 @@ Each part will be explained in the next section.
142142
http_basic:
143143
provider:some_key_from_above
144144
http_basic_ldap:
145-
provider:some_key_from_above
146-
service:ldap
147-
dn_string:'{username}'
145+
provider:some_key_from_above
146+
service:ldap
147+
dn_string:'{username}'
148+
query_string:~
148149
http_digest:
149150
provider:some_key_from_above
150151
guard:
@@ -237,8 +238,9 @@ Each part will be explained in the next section.
237238
# new in Symfony 2.3
238239
require_previous_session:true
239240
240-
service:~
241-
dn_string:'{username}'
241+
service:~
242+
dn_string:'{username}'
243+
query_string:~
242244
243245
remember_me:
244246
token_provider:name

‎security/ldap.rst‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,30 @@ For example, if your users have DN strings in the form
270270
``uid=einstein,dc=example,dc=com``, then the ``dn_string`` will be
271271
``uid={username},dc=example,dc=com``.
272272

273+
query_string
274+
............
275+
276+
**type**: ``string``
277+
278+
This (optional) key enables the user provider to search for a user and
279+
then use the DN found for the bind process. This is useful in environments
280+
with multiple LDAP user providers with a different ``base_dn``. As value
281+
a valid search string for should be used, e.g. ``uid="{username}"``. The
282+
placeholder value will be replaced by the actual username.
283+
284+
When this key is used, ``dn_string`` has to be adjusted accordingly and
285+
should reflect a common denominator as base DN.
286+
287+
Extending the previous example: If Your users have two different DN in the
288+
form of ``dc=companyA,dc=example,dc=com`` and ``dc=companyB,dc=example,dc=com``,
289+
then ``dn_string`` should be ``dc=example,dc=com``. In conjunction with
290+
``uid="{username}"`` as ``query_string`` the authentication provider can
291+
authenticate user from both DN.
292+
293+
Please bear in mind, that the usernames themselves have to be unique
294+
across both DN, as the authentication provider won't determine the
295+
correct user for the bind process if more than one are found.
296+
273297
Examples are provided below, for both ``form_login_ldap`` and
274298
``http_basic_ldap``.
275299

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp