Skip to content
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

Infinite recursion: bind -> connect -> bind -> connect -> .... #122

Closed
Warbo opened this issue Jul 4, 2014 · 4 comments
Closed

Infinite recursion: bind -> connect -> bind -> connect -> .... #122

Warbo opened this issue Jul 4, 2014 · 4 comments

Comments

@Warbo
Copy link

Warbo commented Jul 4, 2014

Just updated to HEAD and got an infinite recursion:

[Fri Jul 4 11:00:33 2014] PHP Fatal error: Maximum function nesting level of '100' reached, aborting! in /home/chris/codebase/webs-new-starter/vendor/imag/ldap-bundle/IMAG/LdapBundle/Manager/LdapConnection.php on line 75
[Fri Jul 4 11:00:33 2014] PHP Stack trace:
[Fri Jul 4 11:00:33 2014] PHP 1. {main}() /home/chris/codebase/webs-new-starter/web/index.php:0
[Fri Jul 4 11:00:33 2014] PHP 2. Silex\Application->run() /home/chris/codebase/webs-new-starter/web/index.php:62
[Fri Jul 4 11:00:33 2014] PHP 3. Silex\Application->handle() /home/chris/codebase/webs-new-starter/vendor/silex/silex/src/Silex/Application.php:515
[Fri Jul 4 11:00:33 2014] PHP 4. Symfony\Component\HttpKernel\HttpKernel->handle() /home/chris/codebase/webs-new-starter/vendor/silex/silex/src/Silex/Application.php:538
[Fri Jul 4 11:00:33 2014] PHP 5. Symfony\Component\HttpKernel\HttpKernel->handleRaw() /home/chris/codebase/webs-new-starter/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:66
[Fri Jul 4 11:00:33 2014] PHP 6. Symfony\Component\EventDispatcher\EventDispatcher->dispatch() /home/chris/codebase/webs-new-starter/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:126
[Fri Jul 4 11:00:33 2014] PHP 7. Symfony\Component\EventDispatcher\EventDispatcher->doDispatch() /home/chris/codebase/webs-new-starter/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventDispatcher.php:53
[Fri Jul 4 11:00:33 2014] PHP 8. call_user_func() /home/chris/codebase/webs-new-starter/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventDispatcher.php:164
[Fri Jul 4 11:00:33 2014] PHP 9. Symfony\Component\Security\Http\Firewall->onKernelRequest() /home/chris/codebase/webs-new-starter/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventDispatcher.php:164
[Fri Jul 4 11:00:33 2014] PHP 10. Symfony\Component\Security\Http\Firewall\BasicAuthenticationListener->handle() /home/chris/codebase/webs-new-starter/vendor/symfony/symfony/src/Symfony/Component/Security/Http/Firewall.php:69
[Fri Jul 4 11:00:33 2014] PHP 11. Symfony\Component\Security\Core\Authentication\AuthenticationProviderManager->authenticate() /home/chris/codebase/webs-new-starter/vendor/symfony/symfony/src/Symfony/Component/Security/Http/Firewall/BasicAuthenticationListener.php:74
[Fri Jul 4 11:00:33 2014] PHP 12. IMAG\LdapBundle\Provider\LdapAuthenticationProvider->authenticate() /home/chris/codebase/webs-new-starter/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Authentication/AuthenticationProviderManager.php:74
[Fri Jul 4 11:00:33 2014] PHP 13. IMAG\LdapBundle\Provider\LdapUserProvider->loadUserByUsername() /home/chris/codebase/webs-new-starter/vendor/imag/ldap-bundle/IMAG/LdapBundle/Provider/LdapAuthenticationProvider.php:71
[Fri Jul 4 11:00:33 2014] PHP 14. IMAG\LdapBundle\Provider\LdapUserProvider->anonymousSearch() /home/chris/codebase/webs-new-starter/vendor/imag/ldap-bundle/IMAG/LdapBundle/Provider/LdapUserProvider.php:64
[Fri Jul 4 11:00:33 2014] PHP 15. IMAG\LdapBundle\Manager\LdapManagerUser->exists() /home/chris/codebase/webs-new-starter/vendor/imag/ldap-bundle/IMAG/LdapBundle/Provider/LdapUserProvider.php:104
[Fri Jul 4 11:00:33 2014] PHP 16. IMAG\LdapBundle\Manager\LdapManagerUser->addLdapUser() /home/chris/codebase/webs-new-starter/vendor/imag/ldap-bundle/IMAG/LdapBundle/Manager/LdapManagerUser.php:32
[Fri Jul 4 11:00:33 2014] PHP 17. IMAG\LdapBundle\Manager\LdapConnection->search() /home/chris/codebase/webs-new-starter/vendor/imag/ldap-bundle/IMAG/LdapBundle/Manager/LdapManagerUser.php:178
[Fri Jul 4 11:00:33 2014] PHP 18. IMAG\LdapBundle\Manager\LdapConnection->connect() /home/chris/codebase/webs-new-starter/vendor/imag/ldap-bundle/IMAG/LdapBundle/Manager/LdapConnection.php:27
[Fri Jul 4 11:00:33 2014] PHP 19. IMAG\LdapBundle\Manager\LdapConnection->bind() /home/chris/codebase/webs-new-starter/vendor/imag/ldap-bundle/IMAG/LdapBundle/Manager/LdapConnection.php:152
[Fri Jul 4 11:00:33 2014] PHP 20. IMAG\LdapBundle\Manager\LdapConnection->connect() /home/chris/codebase/webs-new-starter/vendor/imag/ldap-bundle/IMAG/LdapBundle/Manager/LdapConnection.php:79
[Fri Jul 4 11:00:33 2014] PHP 21. IMAG\LdapBundle\Manager\LdapConnection->bind() /home/chris/codebase/webs-new-starter/vendor/imag/ldap-bundle/IMAG/LdapBundle/Manager/LdapConnection.php:152
[Fri Jul 4 11:00:33 2014] PHP 22. IMAG\LdapBundle\Manager\LdapConnection->connect() /home/chris/codebase/webs-new-starter/vendor/imag/ldap-bundle/IMAG/LdapBundle/Manager/LdapConnection.php:79
[Fri Jul 4 11:00:33 2014] PHP 23. IMAG\LdapBundle\Manager\LdapConnection->bind() /home/chris/codebase/webs-new-starter/vendor/imag/ldap-bundle/IMAG/LdapBundle/Manager/LdapConnection.php:152
(and so on)

@BorisMorel
Copy link
Owner

Hi,
Yeah i think know the bug. You bind a special user for research on your Ldap ?

client:
    username:
    password:

True ?

@Warbo
Copy link
Author

Warbo commented Jul 4, 2014

Yes, we bind as a special user, then authenticate by searching for the given HTTP auth details (via LdapManagerUser::addLdapUser, from what I can tell). Here's the config:

security:
firewalls:
restricted_area:
pattern: ^/
ldap: true
http: true
imag_ldap: ~

providers:
ldap:
id: imag_ldap.security.user.provider

encoders:
IMAG\LdapBundle\User\LdapUser: plaintext

access_control:
- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/, roles: IS_AUTHENTICATED_FULLY }
ldap:
client:
host: blah
username: uid=blah, ou=Special Users, dc=blah
password: blah
skip_roles: true
user:
base_dn: out=People, dc=blah
name_attribute: uid
attributes: []

@BorisMorel
Copy link
Owner

Can you retry plz

@Warbo
Copy link
Author

Warbo commented Jul 4, 2014

Great, it works! Now I can stop using my fork :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants