-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Ldap] Mismatching configuration between LdapClient and AbstractConnection #19008
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
Comments
I think this has been fixed now in 3.1@dev. Can you confirm? |
This should be fixed, indeed. Also, as a reminder, the |
Yep, it's fixed in the dev version, I didn't saw it. LdapClient now calls the normalizeConfig() method, which maps the LdapClient constructor parameters to the AbstractConnection configuration format. @csarrazi I didn't used LdapClient, it was for the demonstration purpose, in my case it was happening when trying to login with a "form_login_ldap" firewall. |
Okay! |
@Julien-Marcou : can you share example of services.yml which uses Symfony\Component\Ldap\Ldap |
The docs haven't been updated for 3.1 yet, indeed. |
For an example:
In short:
Some options are global (host, port, encryption, version, connection_string). Options specific to the implementation ( E.g. <?php
use Symfony\Component\Ldap\Ldap;
$ldap = Ldap::create('ext_ldap', array(
'host' => 'my-ldap-host',
'encryption' => 'ssl',
'version' => 3,
'debug' => true,
'options' => array(
'timelimit' => 2,
'sizelimit' => 5,
'network_timeout' => 10,
'referrals' => true,
),
)); |
In Symfony 3.1.6 get LDAP instance should like this:
config "host" key is not working. |
You should not use You should either change your configuration and use In short, |
as LdapClient has been marked deprecated in 3.1. Refs symfony/symfony#19008
as LdapClient has been marked deprecated in 3.1. Refs symfony/symfony#19008
as LdapClient has been marked deprecated in 3.1. Refs symfony/symfony#19008, symfony#6982
as LdapClient has been marked deprecated in 3.1. Refs symfony/symfony#19008, symfony#6982
as LdapClient has been marked deprecated in 3.1. Refs symfony/symfony#19008, symfony#6982
…razi) This PR was merged into the 3.3 branch. Discussion ---------- Use the Ldap factory in the ldap service definition as LdapClient has been marked deprecated in 3.1. Refs symfony/symfony#19008 @csarrazi Hope this is correct. Commits ------- d428f8d Updated LDAP documentation for Symfony 3.1
Description
When using the Ldap component of Symfony 3.1, binding an LdapClient results in an UndefinedOptionsException.
You can easily reproduce this bug by doing this
What is happening
When creating an instance of LdapClient, a configuration is created using the arguments of the constructor
and an instance of Ldap is automatically created
Which results in instanciating a new Symfony\Component\Ldap\Adapter\ExtLdap\Adapter using the configuration defined above
Then when calling the bind() method of the LdapClient, which call the bind() method of the Ldap, which call the getConnection() method of the Adapter, it results in instanciating a new Symfony\Component\Ldap\Adapter\ExtLdap\Connection using the configuration defined above
But this Connection defines its own configuration format
Which does not match the original configuration defined in the LdapClient, resulting in a UndefinedOptionsException when the OptionResolver tries to resolve the given configuration.
The text was updated successfully, but these errors were encountered: