osixia / docker-openldap

OpenLDAP container image 🐳🌴
MIT License
4.05k stars 977 forks source link

ldap_bind: Invalid credentials (49) #209

Open AlbertShamsiyan opened 6 years ago

AlbertShamsiyan commented 6 years ago

Hi

Executing: docker exec my-openldap-container ldapsearch -x -H ldap://localhost -b dc=example,dc=org -D "cn=admin,dc=example,dc=org" -w admin followed by:
docker run --name my-openldap-container --detach osixia/openldap:1.2.0 will result

# extended LDIF
#
# LDAPv3
# base <dc=example,dc=org> with scope subtree
# filter: (objectclass=*)
# requesting: ALL
#

# example.org
dn: dc=example,dc=org
objectClass: top
objectClass: dcObject
objectClass: organization
o: Example Inc.
dc: example

# admin, example.org
dn: cn=admin,dc=example,dc=org
objectClass: simpleSecurityObject
objectClass: organizationalRole
cn: admin
description: LDAP administrator
userPassword:: e1NTSEF9ek00OCsrR3lMeXU2ckwvcmhUYVJSTzhqaFc3TXdyWUg=

# search result
search: 2
result: 0 Success

# numResponses: 3
# numEntries: 2

YET, executing: docker exec happy_curie ldapsearch -x -H ldap://localhost -b dc=example,dc=org -D "cn=admin,dc=example,dc=org" -w JonSn0w Or docker exec happy_curie ldapsearch -x -H ldap://localhost -b dc=example,dc=org -D "cn=admin,dc=example,dc=org" -w "JonSn0w" Followed by docker run --env LDAP_ORGANISATION="My Company" --env LDAP_DOMAIN="my-company.com" --env LDAP_ADMIN_PASSWORD="JonSn0w" --detach osixia/openldap:1.2.0 Will result:

ldap_bind: Invalid credentials (49)

Any idea what I'm missing ?

AlbertShamsiyan commented 6 years ago

After some digging. docker run --env LDAP_ADMIN_PASSWORD=JonSn0w --detach osixia/openldap:1.2.0 will work. Adding LDAP_ORGANISATION or LDAP_DOMAIN will cause the issue (regardless to special characters)

adaqus commented 6 years ago

@AlbertShamsiyan change -D parameter value according to what is set in LDAP_DOMAIN.

panol commented 6 years ago

@adaqus It works!