Docker-openldap: Invalid DN syntax (34) for user

Created on 16 Apr 2018  路  3Comments  路  Source: osixia/docker-openldap

When I try to connect, when logging with admin and password admin, I get :

Unable to connect to LDAP server ldap-host
--
Error: Invalid DN syntax (34) for user
聽 | Failed to Authenticate to server
Invalid Username or Password.
version: '2'

services:

  ldap-host:
    image: osixia/openldap:1.1.8
    networks:
      mynet:
    environment:
      - LDAP_ORGANISATION="My Company"
      - LDAP_DOMAIN=my-company.com
      - LDAP_ADMIN_PASSWORD=admin

  ldap-admin:
    image: osixia/phpldapadmin:0.6.12
    networks:
      mynet:
    ports:
      - "6080:80"
    environment:
      - PHPLDAPADMIN_LDAP_HOSTS=ldap-host
      - PHPLDAPADMIN_HTTPS=false

networks:
  mynet:
    driver: bridge
    ipam:
      config:
        - subnet: 172.31.0.0/16
          gateway: 172.31.0.1

Most helpful comment

@xero88 thanks for the quick reply and detailed explanation.

I am using Kubernetes, and was able to login successfully using the following user;

CN=admin,DC=example,DC=org

The mistake was in taking the credentials to be literally admin/admin, when in fact the user is a LDAP query. Something which I have recently began looking at.

Thanks,
Dean.

All 3 comments

I get the exact same error. Did you manage to find out the problem?

yes @deancarr , this is how I managed :

1. Create a network for ensure communication between openldap-mydomain and lam-mydomain

docker network create ldap-network

2. Create the containers

docker run -p 0.0.0.0:389:389 -p 0.0.0.0:636:636 --name openldap-mydomain --net ldap-network --env LDAP_ORGANISATION="mydomain" --env LDAP_DOMAIN="mydomain.com" --env LDAP_TLS=false --restart=always --detach osixia/openldap:1.2.0

docker run -p 0.0.0.0:8080:8080 --name lam-mydomain --net ldap-network --restart=always --detach computersciencehouse/ldap-account-manager

3. Check if containers are running

docker inspect openldap-mydomain | grep Status

docker inspect lam-mydomain | grep Status

If "Status": "running" is returned, then your docker installation is running

4. Check if the openldap structure is created

docker exec openldap-mydomain ldapsearch -x -H ldap://localhost -b dc=mydomain,dc=com -D "cn=admin,dc=mydomain,dc=com" -w admin | grep result

If result: 0 Success is returned, then the open ldap structure is right.

docker network create ldap-network

2. Create the containers

docker run -p 0.0.0.0:389:389 -p 0.0.0.0:636:636 --name openldap-mydomain --net ldap-network --env LDAP_ORGANISATION="mydomain" --env LDAP_DOMAIN="mydomain.com" --env LDAP_TLS=false --restart=always --detach osixia/openldap:1.2.0

docker run -p 0.0.0.0:8080:8080 --name lam-mydomain --net ldap-network --restart=always --detach computersciencehouse/ldap-account-manager

3. Check if containers are running

docker inspect openldap-mydomain | grep Status

docker inspect lam-mydomain | grep Status

If "Status": "running" is returned, then your docker installation is running

4. Check if the openldap structure is created

docker exec openldap-mydomain ldapsearch -x -H ldap://localhost -b dc=mydomain,dc=com -D "cn=admin,dc=mydomain,dc=com" -w admin | grep result

If result: 0 Success is returned, then the open ldap structure is right.

@xero88 thanks for the quick reply and detailed explanation.

I am using Kubernetes, and was able to login successfully using the following user;

CN=admin,DC=example,DC=org

The mistake was in taking the credentials to be literally admin/admin, when in fact the user is a LDAP query. Something which I have recently began looking at.

Thanks,
Dean.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

adambom picture adambom  路  6Comments

LeaklessGfy picture LeaklessGfy  路  4Comments

tobikris picture tobikris  路  4Comments

Holt59 picture Holt59  路  4Comments

dalareo picture dalareo  路  5Comments