Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Ldap] Added the possibility to configure all available Ldap options for connection #18725

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 1 commit into from
May 13, 2016
Merged

[Ldap] Added the possibility to configure all available Ldap options for connection #18725

merged 1 commit into from
May 13, 2016

Conversation

csarrazi
Copy link
Contributor

@csarrazi csarrazi commented May 8, 2016

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #18448
License MIT
Doc PR

This PR lets a user configure all documented Ldap options, as well as a few undocumented ones (back-ported from the OpenLdap C library, as well as the Ldap client specification).

@csarrazi
Copy link
Contributor Author

csarrazi commented May 8, 2016

@fabpot I know it is already quite late, and that we are currently in the stabilisation step of the release, but this would really be a welcome addition (easier debugging, for example).


return $value;
$resolver->setAllowedTypes('host', 'string');
Copy link
Contributor

Choose a reason for hiding this comment

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

Take into account that OptionsResolver has fluent setters, which allows you to chain multiple calls.

'useSsl' => false,
'useStartTls' => false,
'optReferrals' => false,
'connectionString' => null,
Copy link
Member

Choose a reason for hiding this comment

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

This should be connection_string. All options in Symfony are underscored.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True. I'll change this for optReferrals too, which is in the ExtLdap-specific code.

'useStartTls' => false,
'optReferrals' => false,
'connection_string' => null,
'encryption' => 'none',
Copy link
Member

Choose a reason for hiding this comment

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

What about 'secure' instead of encryption?

Copy link
Contributor Author

@csarrazi csarrazi May 13, 2016

Choose a reason for hiding this comment

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

encryption having a value of none, tls or ssl, I think something like array('secure' => 'ssl') would make it misleading, as we are only talking about encryption over the wire, not neither authentication or RBAC.

@fabpot
Copy link
Member

fabpot commented May 13, 2016

Thank you @csarrazi.

@fabpot fabpot merged commit a8bae31 into symfony:master May 13, 2016
fabpot added a commit that referenced this pull request May 13, 2016
…e Ldap options for connection (csarrazi)

This PR was merged into the 3.1-dev branch.

Discussion
----------

[Ldap] Added the possibility to configure all available Ldap options for connection

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #18448
| License       | MIT
| Doc PR        |

This PR lets a user configure [all documented Ldap options](http://php.net/manual/fr/function.ldap-get-option.php), as well as a few undocumented ones (back-ported from the [OpenLdap C library](http://linux.die.net/man/3/ldap_set_option), as well as the [Ldap client specification](https://www.ietf.org/proceedings/50/I-D/ldapext-ldap-c-api-05.txt)).

Commits
-------

a8bae31 Added the possibility to configure all Ldap options for connection
@fabpot fabpot mentioned this pull request May 13, 2016
@uvups
Copy link

uvups commented Jun 1, 2016

This change seems to have broken the 3.1 Ldap authentication.

Using the documented service setup

services:
    ldap:
        class: 'Symfony\Component\Ldap\LdapClient'
        arguments:
            - my-server   # host
            - 389         # port
            - 3           # version
            - false       # SSL
            - true        # TLS

Always produces this error message:

The options "optReferrals", "useSsl", "useStartTls" do not exist. Defined options are: "connection_string", "debug", "encryption", "host", "options", "port", "referrals", "version".

There seems to be no way to successfully configure an Ldap service.

@csarrazi csarrazi deleted the feature/ldap-options branch June 1, 2016 19:39
@csarrazi
Copy link
Contributor Author

csarrazi commented Jun 1, 2016

@uvups Indeed. I'm providing a fix ASAP. (in the next 5 minutes)

fabpot added a commit that referenced this pull request Jun 8, 2016
…razi)

This PR was merged into the 3.1 branch.

Discussion
----------

[Ldap] Fixed issue with legacy client initialisation

| Q             | A
| ------------- | ---
| Branch?       | 3.1
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #18725 (comment)
| License       | MIT
| Doc PR        |

Thanks @uvups for noticing this.

Commits
-------

6804efe Fixed issue with legacy client initialization
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants