8000 Added query_string LDAP config option by lsmith77 · Pull Request #7420 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

Added query_string LDAP config option #7420

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

Merged
merged 4 commits into from
Feb 28, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
clean up
  • Loading branch information
lsmith77 committed Feb 3, 2017
commit b82cafd2ee30715ecd735419d2617e11e0348249
6 changes: 3 additions & 3 deletions reference/configuration/security.rst
Original file line number Diff line number Diff line change
Expand Up @@ -454,10 +454,10 @@ query_string
**type**: ``string`` **default**: ``null``

This is the string which will be used to query for the DN. The ``{username}``
placeholder will be replaced with the user-provided value (his login).
placeholder will be replaced with the user-provided value (their login).
Depending on your LDAP server's configuration, you will need to override
this value. This setting is only necessary if the users DN cannot be derived
statically using the `dn_string` config option.
this value. This setting is only necessary if the user's DN cannot be derived
statically using the ``dn_string`` config option.

User provider
~~~~~~~~~~~~~
Expand Down
28 changes: 2 additions & 26 deletions security/ldap.rst
Original file line number Diff line number Diff line change
Expand Up @@ -295,19 +295,6 @@ than one is found.
Examples are provided below, for both ``form_login_ldap`` and
``http_basic_ldap``.

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

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

This optional key defines the form of the query used in order to search the
DN of the user, from the username. The ``{username}`` string is replaced by
the actual username of the person trying to authenticate.

This setting is only necessary if the users DN cannot be derived statically
using the `dn_string` config option.


Configuration example for form login
....................................

Expand All @@ -323,8 +310,6 @@ Configuration example for form login
main:
# ...
form_login_ldap:
login_path: login
check_path: login_check
# ...
service: ldap
dn_string: 'uid={username},dc=example,dc=com'
Expand All @@ -342,8 +327,6 @@ Configuration example for form login
<config>
<firewall name="main">
<form-login-ldap
login-path="login"
check-path="login_check"
service="ldap"
dn-string="uid={username},dc=example,dc=com" />
</firewall>
Expand All @@ -356,8 +339,6 @@ Configuration example for form login
'firewalls' => array(
'main' => array(
'form_login_ldap' => array(
'login_path' => 'login',
'check_path' => 'login_check',
'service' => 'ldap',
'dn_string' => 'uid={username},dc=example,dc=com',
// ...
Expand Down Expand Up @@ -432,8 +413,6 @@ Configuration example for form login and query_string
main:
# ...
form_login_ldap:
login_path: login
check_path: login_check
# ...
service: ldap
dn_string: 'dc=example,dc=com'
Expand All @@ -452,23 +431,20 @@ Configuration example for form login and query_string
<config>
<firewall name="main">
<form-login-ldap
login-path="login"
check-path="login_check"
service="ldap"
dn-string="dc=example,dc=com"
query-string="(&(uid={username})(memberOf=cn=users,ou=Services,dc=example,dc=com))" />
query-s 99A2 tring="(&amp;(uid={username})(memberOf=cn=users,ou=Services,dc=example,dc=com))" />
</firewall>
</config>
</srv:container>

.. code-block:: php

// app/config/security.php
$container->loadFromExtension('security', array(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should add the // app/config/security.php comment above

'firewalls' => array(
'main' => array(
'form_login_ldap' => array(
'login_path' => 'login',
'check_path' => 'login_check',
'service' => 'ldap',
'dn_string' => 'dc=example,dc=com',
'query_string' => '(&(uid={username})(memberOf=cn=users,ou=Services,dc=example,dc=com))',
Expand Down
0