LDAP (Lightweight Directory Access Protocol) is a directory information service that allows you to centrally store information and share it across an IP network. In an LDAP service, information is stored in objects called entries, which can contain a variety of data—including authentication information. LDAP entries are often used to store authentication information because data storage is centralized, thereby simplifying maintenance when changes occur.

The driver supports user ID and password authentication.

To configure the driver to use LDAP authentication:

  • Set the Host Name (HostName) option to specify the name or the IP address of the MongoDB server to which you want to connect. For example, myserver.
  • Set the AuthenticationMethod to 17.
  • Set the User (User) option to specify your user ID.
  • Set the Password (Password) option to specify the password for the user connecting to the instance.
  • Optionally, set the Database Name (DatabaseName) option to specify the name of the database to which you are connecting.
  • Optionally, specify values for any additional options you want to configure.
Note: The User and Password options are not required to be stored in the connection string. They can also be sent separately by the application using the SQLConnect ODBC API. For SQLDriverConnect and SQLBrowseConnect, they will need to be specified in the connection string.

The following examples show the connection information required to establish a session with LDAP authentication.

Connection string

DRIVER=DataDirect 8.1 MongoDB;AuthenticationMethod=17;DatabaseName=mydb;
       HostName=myserver;User=jsmith;Password=secret;

odbc.ini

[MongoDB]
Driver=ODBCHOME/lib/ivmongodb81.so
...
Description=DataDirect 8.1 MongoDB
...
AuthenticationMethod=17
...
DatabaseName=mydb
...
HostName=myserver
...
User=jsmith
...
Password=secret
...