DirectoryTree / LdapRecord-Laravel

Multi-domain LDAP Authentication & Management for Laravel.
https://ldaprecord.com/docs/laravel/v3
MIT License
512 stars 54 forks source link

[Support] Need help to connect ldapRecord with bitnami/openldap #617

Closed MaxR522 closed 10 months ago

MaxR522 commented 10 months ago

Environment:

Hi @stevebauman ,

I tried to use ldapRecord-laravel, and I want to connect it with bitnami/openldap docker image using a docker-compose file, this is the docker-compose file looks like:

version: '3.8'
services:
    openldap:
        image: bitnami/openldap:2.6.6-debian-11-r61
        ports:
        - '1389:1389'
        environment:
            LDAP_ADMIN_USERNAME: ${LDAP_DEFAULT_USERNAME}
            LDAP_ADMIN_PASSWORD: ${LDAP_DEFAULT_PASSWORD}
            LDAP_ROOT: ${LDAP_DEFAULT_BASE_DN}
            LDAP_GROUP: ${LDAP_DEFAULT_GROUP}
            BITNAMI_DEBUG: 'true'
        volumes:
            - localLDAP:/bitnami/openldap
volumes:
    localLDAP:

And these are the env inside .env:

LDAP_LOGGING=true
LDAP_CONNECTION=default
LDAP_CONNECTIONS=default

LDAP_DEFAULT_HOSTS=0.0.0.0
LDAP_DEFAULT_USERNAME="cn=admin,dc=local,dc=com"
LDAP_DEFAULT_PASSWORD=XXXXXX
LDAP_DEFAULT_PORT=1389
LDAP_DEFAULT_BASE_DN="dc=local,dc=com"
LDAP_DEFAULT_TIMEOUT=5
LDAP_DEFAULT_SSL=false
LDAP_DEFAULT_TLS=false
LDAP_DEFAULT_SASL=false
LDAP_DEFAULT_GROUP=WRITTER

My problem is, when I run the php artisan ldap:test, I always get the error: "invalid credential", this is the full output

Testing LDAP connection [default]...
+------------+------------+---------------------------+----------------------------------------------------------------+---------------+
| Connection | Successful | Username                  | Message                                                        | Response Time |
+------------+------------+---------------------------+----------------------------------------------------------------+---------------+
| default    | ✘ No       | cn=admin,dc=local,dc=com | Invalid credentials. Error Code: [49] Diagnostic Message: NULL | 384ms         |
+------------+------------+---------------------------+----------------------------------------------------------------+---------------+

Can you help me finding what's wrong with this configuration please ?

stevebauman commented 10 months ago

Hi @MaxR522,

I think your host IP is incorrect. Can you try "localhost" as well as "127.0.0.1"?

MaxR522 commented 10 months ago

Hi @MaxR522,

I think your host IP is incorrect. Can you try "localhost" as well as "127.0.0.1"?

Hello! Thanks for your answer, I changed the image using this instead: https://github.com/osixia/docker-openldap And it works fine Thank you