LDAP Password required in Laravel but not in non-laravel version #502
-
I'm having a couple of issues that I'm struggling with, this is the first one. I setup the stand alone version OUTSIDE of laravel and can connect just fine to our LDAP server. Our LDAP/AD server is not protected by a password and instead is using network security to protect it. In the NON Laravel version when I set the password to blank, it works. I installed in a Laravel APP and when I do the ldap test command it shows TRUE, that it connected. Then I tried in tinker after installing using this:
And this returns Is there an easy way to override this behavior in the Laravel version? It would be nice if the PW wasn't required like in the NON Laravel version. If I comment out the password check in |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi @chrispian, You must use the use LdapRecord\Container;
$connection->auth()->bind('USER NAME GOES HERE', null); The Let me know if you encounter anything else 👍 |
Beta Was this translation helpful? Give feedback.
-
@stevebauman Perfect, thank you! That works. Derp, I almost tried that but got distracted and must have thought I tried it. Appreciate the quick reply! |
Beta Was this translation helpful? Give feedback.
Hi @chrispian,
You must use the
bind()
method to anonymously connect to your LDAP server and providenull
as the password:The
attempt()
method is meant to be provided to end-users so that blank passwords cannot be provided to allow anonymous binding.Let me know if you encounter anything else 👍