MongoDB Documentation, Release 3.0.4 To use this sample OpenLDAP configuration, create users with a uid attribute (login name) and place under the Users organizational unit ( ou ) under the domain components ( dc ) example and com . For more information on saslauthd configuration, see http://www.openldap.org/doc/admin24/guide.html#Configuringsaslauthd. Step 4: Test the saslauthd configuration. Use testsaslauthd utility to test the saslauthd configuration. For example: Step 1: Add user to MongoDB for authentication. Add the user to the $external database in MongoDB. To specify the user’s privileges, assign roles (page 324) to the user. For example, the following adds a user with read-only access to the records database. Add additional principals as needed. For more information about creating and managing users, see http://docs.mongodb.org/manual/reference/command/nav-user-management . Configure MongoDB 371 6.3. Security Tutorials $^{61}$http://docs.mongodb.org/v2.4/reference/configuration-options Or, if using the older configuration file format$^{61}$: Or if using a YAML format configuration file , specify the following settings in the file: Use specific saslauthd socket path. For socket path of /<some>/<path>/saslauthd , set the saslauthdPath to /<some>/<path>/saslauthd/mux , as in the following command line example: Configure the MongoDB server using either the command line option --setParameter or the configuration file . Specify additional configurations as appropriate for your configuration. If you use the authorization option to enforce authentication, you will need privileges to create a user. Step 2: Configure MongoDB server. To configure the MongoDB server to use the saslauthd instance for proxy authentication, start the mongod with the following options: testsaslauthd -u testuser -p testpassword -f /var/run/saslauthd/mux db.getSiblingDB("$external").createUser( { user : <username>, roles: [ { role: "read", db: "records" } ] } ) mongod --auth --setParameter saslauthdPath=/<some>/<path>/saslauthd/mux --setParameter security: authorization: enabled setParameter: saslauthdPath: /<some>/<path>/saslauthd/mux authenticationMechanisms: PLAIN • --auth , • authenticationMechanisms parameter set to PLAIN , and • saslauthdPath parameter set to the path to the Unix-domain Socket of the saslauthd instance.