익명 06:23

Unable to bind to LDAP server

Unable to bind to LDAP server

Environment:

LDAP Server: ActiveDirectory

LdapRecord-Laravel: v2.5

PHP Version: 8.0

Using ldaprecord returns:

"ldap_bind(): Unable to bind to server: Can't contact LDAP server. Error Code: [-1"

PHP artisan ldap:test:

Connection | Successful | Username | Message | Response Time |
+------------+------------+----------+-------------------------------------------------------------------------------------------------------------+---------------+
| default | ✘ No | | ldap_bind(): Unable to bind to server: Can't contact LDAP server. Error Code: [-1] Diagnostic Message: null | 10082.94ms |

env.file:

LDAP_LOGGING=true 
LDAP_CONNECTION=default 
LDAP_CONNECTIONS=default 
LDAP_DEFAULT_HOSTS=ldap.forumsys.com 
LDAP_DEFAULT_USERNAME=null 
LDAP_DEFAULT_PASSWOR=null 
LDAP_DEFAULT_PORT=389 
LDAP_DEFAULT_BASE_DN="cn=read-only-admin" 
LDAP_DEFAULT_TIMEOUT=5 
LDAP_DEFAULT_SSL=false 
LDAP_DEFAULT_TLS=false 

How I can fix this?



Top Answer/Comment:

See this example

You'll need to set a proper user and password for LDAP_DEFAULT_USERNAME and LDAP_DEFAULT_PASSWORD.

Your LDAP_DEFAULT_BASE_DN is not supposed to be a user, rather the OU you want to enter with LDAP which contians everything you want to query.

Example for the whole domain: "dc=local,dc=com"

Also make sure your domain controller is reachable on TCP 389 from your system.

상단 광고의 [X] 버튼을 누르면 내용이 보입니다