8000 Explain the query_string ldap authentication provider configuration key by nietonfir · Pull Request #7414 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

Explain the query_string ldap authentication provider configuration key #7414

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions reference/configuration/security.rst
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,10 @@ Each part will be explained in the next section.
http_basic:
provider: some_key_from_above
http_basic_ldap:
provider: some_key_from_above
service: ldap
dn_string: '{username}'
provider: some_key_from_above
service: ldap
dn_string: '{username}'
query_string: ~
http_digest:
provider: some_key_from_above
guard:
Expand Down Expand Up @@ -237,8 +238,9 @@ Each part will be explained in the next section.
# new in Symfony 2.3
require_previous_session: true

service: ~
dn_string: '{username}'
service: ~
dn_string: '{username}'
query_string: ~

remember_me:
token_provider: name
Expand Down
22 changes: 22 additions & 0 deletions security/ldap.rst
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,28 @@ For example, if your users have DN strings in the form
``uid=einstein,dc=example,dc=com``, then the ``dn_string`` will be
``uid={username},dc=example,dc=com``.

query_string
............

**type**: ``string`` **default**: ``null``

This (optional) key makes the user provider search for a user and then use the
found DN for the bind process. This is useful when using multiple LDAP user
providers with different ``base_dn``. The value of this option must be a valid
search string (e.g. ``uid="{username}"``). The placeholder value will be
replaced by the actual username.

When this option is used, ``dn_string`` has to be updated accordingly. Following
the previous example, if your users have the following two DN:
``dc=companyA,dc=example,dc=com`` and ``dc=companyB,dc=example,dc=com``, then
``dn_string`` should be ``dc=example,dc=com``. If the ``query_string`` option is
``uid="{username}"``, then the authentication provider can authenticate users
from both DN.

Bear in mind that usernames must be unique across both DN, as the authentication
provider won't be able to select the correct user for the bind process if more
than one is found.

Examples are provided below, for both ``form_login_ldap`` and
``http_basic_ldap``.

Expand Down
0