Connection for multiple users laravel8 + ldapRecord #283
-
I've been configuring this plugin for a couple of days in laravel 8 + jetstream, I've only been able to get it to login when I configure a particular user in the .env LDAP_USERNAME=midominio\user.lastname but leaving null: LDAP_USERNAME=null so that any user can login, it always shows me the same message: "These credentials do not match our records ." I have searched a lot on the internet, including following the documentation on the official website, but without any good results. I would greatly appreciate your help. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @karlitoxz,
This isn't how it works. The Even while connecting anonymously to your LDAP server, users attempting to login will still need to have a valid username and password. This would be a major security risk if your above use-case was possible. If you still want to do this, you will have to override the authenticator And here is the documentation to do so: https://ldaprecord.com/docs/laravel/v2/extending/#authentication |
Beta Was this translation helpful? Give feedback.
Hi @karlitoxz,
This isn't how it works. The
LDAP_USERNAME
andLDAP_PASSWORD
simply gives you access to your LDAP server so your Laravel application can communicate with it. Setting both tonull
will simply connect to your LDAP server through what's called anonymous binding.Even while connecting anonymously to your LDAP server, users attempting to login will still need to have a valid username and password.
This would be a major security risk if your above use-case was possible.
If you still want to do this, you will have to override the authenticator
attempt()
method here:LdapRecord-Laravel/src/LdapUserAuthenticator.php
Line 75 in 76dffd3