-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Ldap] Fixing the behaviour of getting LDAP Attributes #41527
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
Conversation
Hey! I see that this is your first PR. That is great! Welcome! Symfony has a contribution guide which I suggest you to read. In short:
Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change. When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor! I am going to sit back now and wait for the reviews. Cheers! Carsonbot |
Shouldn't this PR target a lower branch, eg 4.4? |
Here the snippents from my config. Without the modification the memberOf will fail. It took me half a day of researching because the documentation is missing the service tag for the ldap service. # /config/packages/security.yaml
security:
enable_authenticator_manager: true
providers:
provider_ldap:
ldap:
service: Symfony\Component\Ldap\Ldap
base_dn: dc=planetexpress,dc=com
search_dn: cn=admin,dc=planetexpress,dc=com
search_password: GoodNewsEveryone
default_roles: ROLE_USER
uid_key: uid
extra_fields: ['givenName','sn','mail','memberOf']
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
lazy: true
form_login_ldap:
service: Symfony\Component\Ldap\Ldap
enable_csrf: true
login_path: login
check_path: login
dn_string: dc=planetexpress,dc=com
query_string: '(&(uid={username}))'
search_dn: cn=admin,dc=planetexpress,dc=com
search_password: GoodNewsEveryone
logout:
path: logout
access_control:
- { path: ^/login, roles: IS_ANONYMOUS }
- { path: ^/, roles: ROLE_USER } # /config/services.yaml
services:
Symfony\Component\Ldap\Ldap:
arguments: ['@Symfony\Component\Ldap\Adapter\ExtLdap\Adapter']
# the documentation is missing the service tag
tags: ['ldap']
Symfony\Component\Ldap\Adapter\ExtLdap\Adapter:
arguments:
- host: localhost
port: 10386
#encryption: tls
options:
protocol_version: 3
referrals: false |
This should target 🎯 4.4 and can you please add a testcase to avoid further regression? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM as a new feature.
Thank you @mr-sven. |
3d2ced7
to
d75b475
Compare
Some of the attributes in LDAP are not shipped via
filter = *
, they have to be requested. Example thememberOf
attribute using the OpenLDAP docker demorroemhild/docker-test-openldap
. ThememberOf
attribute is an overlay and only available on request.ldapsearch example without requesting
memberOf
:ldapsearch example with requesting
memberOf
: