-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Documentation for the new Ldap component #5756
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
ping @csarrazi - this is one that I won't be able to right, without great trouble as I don't have any real LDAP experience. Are you able to add a document in the new 2 weeks? |
You know that there is https://packagist.org/packages/org_heigl/zendldapbundle ? Is there really the need for another LDAP-Implementation? |
@heiglandreas The LdapBundle you are mentioning does basically nothing, and does not expose all LDAP options. The goal here is to have a working basic LDAP implementation, which is used by the SecurityBundle for authenticating a user against a LDAP server. @weaverryan Could do, but first, I need to finalize symfony/symfony#15994, as the Ldap API will actually change a lot before the final release. |
@csarrazi I'm fully aware, that it does nothing except allowing a user to use Zend\Ldap inside symfony. As far as I know, there are some 3rd-party LDAP-Authentication bundles around but the last time I looked, there wasn't a full-featured LDAP-implementation. That's why I created that bundle. So when I understand you right the new LDAP-component will have all the features necessary to authenticate a user but not necessary all features needed for full LDAP-usage? |
In the long term, it will have all features for full LDAP usage. And provided we have users who actually want this feature. |
Just out of interest: Wouldn't it be easier to combine forces on one LDAP-AL and use that in different frameworks instead of splitting the contributors over different implementations? I'm maintaining Zend\Ldap and currently I'm the only one doing any actual work on it. And as it's a part that is not that widely used or understood splitting the contributor-base to such an AL is IMO removing power from every single project. Wouldn't having one AL implemented by the different frameworks be a more powerfull solution? |
@heiglandreas This would have been great. However, the main reason why I did not use Zend\Ldap is because of the error handler's after effects, as mentioned on zendframework/zendframework#7497. Indeed, during my tests, Zend\Ldap used to break the Symfony error handler, which is not registered back after If these issues are fixed at a later time, I would be glad to provide a bridge for using For the record, at first this component wasn't even supposed to exist. The implementation is very simple, and is intended to be kept simple. |
Then let's join forces @csarrazi ;) I'll dig into that issue with the error handler and check whether there is a way to get rid of the Please don't get me wrong: Even though I'm maintaining Zend\Ldap I do not think it's the perfect AbstractionLayer. But it's there and with the contributor-base for LDAP being rather sparse I think it makes sense to try to keep one AbstractionLayer stable and current instead of creating multiple ones that after a brief intense period will rust away... |
Ping @fabpot |
When I wrote FR3DLdapBundle started using the PHP builting LDAP functions but I've found for to deal with the whole universe of LDAP vendors (Microsoft, Linux, ...) an abstraction layer is needed. Then I thought I could maintain to versions and allow the developer to customize when use builtin functions or Zend\Ldap, finally I've found maintain the builtin functions is a waste of time. I think it's possible to work in a single implementation and fix any issues. Disclaimer: While I'm related to zendframework organization my experience with SF2 LDAP integration (FR3DLdapBundle) is previous to my relation with zend-ldap. |
@csarrazi Most people open issues against my bundle asking why it's not possible use the credentials provided in the user form as credentials for perform LDAP search ( I've to close those issues because input credentials are not available at the user provider time. Do you think this could be possible in a future SF version? |
Nice to have LDAP built into the symfony core 👍 Worth a look is also the django.Ldap Extension which works quite well: It should be possible to port the abstraction layer @Maks3w mentions from python to PHP. At least OpenLDAP compard to ActiveDirectory seem to have diverged schemas from W2008 Server onwards. Also a "nice to have" would be union searches, like search more than one base path: |
@Maks3w @heiglandreas Great discussion! :) What we can do for now: For Symfony 2.8 / 3.0, let's keep the LDAP component as is (I mean with the current interface). I'll try to see whether I can refactor the current PR to create a bridge from the current code, to keep compatibility with the current implementation. Release 2.8 / 3.0 should not be delayed because of this. By the way, @heiglandreas, you could also take a look at https://github.com/symfony/polyfill-php56, for simplifying your |
@csarrazi Thanks for pointing that one out! I'll first want to get the changes for the ErrorHandling in. And I'm absolutely with you to not delay a scheduled release due to a possible different implementation. Though knowing where to go might enable everyone to tweak new code into a certain direction to make the transition easier when it comes to it. When is the release after 3.0 scheduled? |
The release after 3.0 would be scheduled around march 2016, which makes it a reasonable target. |
ping @csarrazi |
@weaverryan the documentation cannot be done until some decision is taken on PR symfony/symfony#15994 |
FYI, the component is now marked as internal (see symfony/symfony#16735). |
Is this bundle still not ready to get some documentation? |
First, it is not a bundle. Second, yes, it is mature enough (only the @xabbuh I think this should not be in the |
@csarrazi Excuse my ignorance. It is a component, right? |
No problem, @Dragnucs! 😃 |
@csarrazi One more stupid question. How should I configure the |
Which version of Symfony are you using? 2.8/3.0? Or 3.1/master? |
I am using Symfony 3.0.3 and Symfony\Ldap dev-master |
app.ldap:
class: Symfony\Component\Ldap\Ldap
factory: ['Symfony\Component\Ldap\Ldap', 'create']
arguments:
- 'ext_ldap'
- host: 'host.mydomain.com' In short, you should use However, if you are using Symfony 3.0, you should instead use the In that case, you should use app.ldap:
class: Symfony\Component\Ldap\LdapClient
arguments: ['host.mydomain.com'] |
Using the |
As mentioned, if using Symfony 2.8 or 3.0, you should use |
@csarrazi Please would you mind prompting a way to use Ldap component with custom User class. What I need is to authenticate users in LDAP, but load their roles and some attributes from other source (e.g. database).
Oh, I think I have found the answer: I should use Ldap component only as authenticator and create custom user provider to fetch user data from DB. |
@trofimchouk Exactly! |
Basically, all you need to do is use the |
Hi, I have done a quick (and a little bit ugly fix) on my own fork to confirm this was the issue and indeed after ensuring that a password is always provided it worked. So, can you confirm if this is a bug or I missed to tune some setting? If it is a bug I can make a pull request. Thanks. |
This indeed looks like a bug. Could you file an issue on symfony/symfony? |
I found this after submitting #6795 but I can separate my question if it is confusing to the general discussion here. The LDAP documentation doesn't answer the main question of data safety. Unless I'm missing something, which if I am my apologies. Basically, my question is on the safety implemented in the component. The Doctrine chapter does a good job of explaining and providing references to parameterized queries and how SQL injection is handled. Where is the responsibility for protecting against, or at least mitigating, LDAP injection attacks? Is that solely on the developer or does the component provide some of that functionality? Can that be made more clear in the documentation? |
After reading all this, I am a little confused as to whether I should be using Ldap or LdapClient in Symfony 3.2.3. My goal is to use the form_login_ldap and the ldap user provider if possible. I am using Microsoft AD. If not, I will implement my own user provider. I'm pretty new to Symfony. |
You should be using Ldap rather than LdapClient. While both will work, only the Ldap class will be supported onwards, and will add new features. |
Closing it as "fixed". The basic docs are online (https://symfony.com/doc/current/components/ldap.html) and the better docs are pending to be merged (#6982). |
…razi, javiereguiluz) This PR was submitted for the 3.1 branch but it was merged into the 3.3 branch instead (closes #6982). Discussion ---------- [Ldap] Updated Ldap component documentation for 3.1 | Q | A | | --- | --- | | Doc fix? | no | | New docs? | yes | | Applies to | 3.1, 3.2 | | Fixed tickets | #5756 | Unfortunately, I didn't have the time to update the docs since I have been pretty busy these last months, but like people say, better late than never! The documentation has been updated for version 3.1 of the Ldap component, which no longer uses the same class, and now provides an LdapManager which can create new LDAP entries, or manipulate existing ones (update or delete). I didn't add a documentation section regarding the legacy classes, but I figure that they should no longer be described as the main entry points for the Ldap component. Commits ------- 066f5be Minor fixes 78ed43d Updated LDAP documentation for Symfony 3.1
see symfony/symfony#14602
The text was updated successfully, but these errors were encountered: