# Percona LDAP configuration

**URL:** <https://forums.percona.com/t/percona-ldap-configuration/5062>\
**Category:** Percona Server for MongoDB\
**Created:** [August 30, 2016, 11:52am UTC](https://forums.percona.com/t/percona-ldap-configuration/5062 "2016-08-30T11:52:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![numanoids](https://avatars.discourse-cdn.com/v4/letter/n/b38774/32.png) [@numanoids](https://forums.percona.com/u/numanoids)\
**Post date:** [August 30, 2016, 11:52am UTC](https://forums.percona.com/t/percona-ldap-configuration/5062/1 "2016-08-30T11:52:34Z")

</div>

Hi all,

First time posting however could do with any help anyone could provide. I’ve setup percona mongodb inside a container and as part of that container i’ve also got saslauthd running. I’m able to do the testsaslauthd piece fine and it proves my connection to our AD is working fine.

The container is RHEL based and i’ve put my mongo.conf definition in /etc/sasl2/ however I’m unable to get LDAP authentication working. When i attempt with the following command:

db.getSiblingDB(“$external”).auth( { user : “user”, pwd : “pass”, mechanism: “PLAIN”, digestPassword: false } ) ;

I get the following error:

Error: Missing expected field “mechanism”

Despite it being referenced in the authentication string, the log file isn’t yielding anything valuable either and neither is the saslauthd log but I suspect it isn’t even getting as far as trying to talk go the saslauthd daemon.

If anyone can assist in shedding any light on this i’d be greatly appreciative.

Thanks

---

<div class="post-metadata">

**Author:** ![numanoids](https://avatars.discourse-cdn.com/v4/letter/n/b38774/32.png) [@numanoids](https://forums.percona.com/u/numanoids)\
**Post date:** [August 31, 2016, 12:35pm UTC](https://forums.percona.com/t/percona-ldap-configuration/5062/2 "2016-08-31T12:35:25Z")

</div>

Just following up on my own post, i’ve resolved this myself. For anyone’s reference it requires ensuring the cyrus-sasl-plain package is present. In fairness i’ve not had much experience with sasl so i’m glad to have figured this out.

---

<div class="post-metadata">

**Author:** ![zhanglu9](https://avatars.discourse-cdn.com/v4/letter/z/90db22/32.png) [@zhanglu9](https://forums.percona.com/u/zhanglu9)\
**Post date:** [November 3, 2016, 12:09pm UTC](https://forums.percona.com/t/percona-ldap-configuration/5062/3 "2016-11-03T12:09:29Z")

</div>

Hi Numanoids,  
I have set this up on CentOS 7 and got same error message when trying to auth against OpenLDAP. The LDAP server is on local host, user openldapper was created and “testsaslauthd -u openldapper -p secret” returned Success. ldap-sample-server/ldap-sample-client test also returned success. When trying to authenticate the user, this message shows up.  
Also, if I had cyrus-sase-ldap installed, starting mongod will result message “mongod: ldapdb\_canonuser\_plug\_init() failed in sasl\_canonuser\_add\_plugin(): invalid parameter supplied” in /var/log/messages. Do you need to install cyrus-sasl-ldap package?

Do you mind to list the files you need to create/modify?

Thanks
