Using LDAP

You can configure the connector to use the LDAP protocol to authenticate the connection.

You provide the configuration information to the connector in the connection URL. For more information about the syntax of the connection URL, see Building the Connection URL.

To configure LDAP authentication:

  • Connect to the server using a connection URL written in the following format:
  • jdbc:mongodb://[UserName]:[Password]@[Host]:[Port]/[Database]?AuthMechanism=PLAIN

The variables are defined as follows:

  • [UserName] is your MongoDB user name.
  • [Password] is the password corresponding to your MongoDB user name.
  • [Host] is the DNS or IP address of the server.
  • [Port] is the number of the TCP port to connect to. Specifying the port number is optional if you are connecting to port 27017.
  • [Database] is the name of the database.
Important:

Important:

If the user name or password contains reserved characters, those characters must be encoded using URL encoding (percent encoding). For example, the user name ch@ng would be encoded in the connection URL as ch%40ng.

For example:

jdbc:mongodb://jsmith:pass12345@192.168.1.1:47017/
TeamRoster?AuthMechanism=PLAIN