Configuring Authentication
Some MongoDB databases require authentication. You can configure the Simba MongoDB ODBC Connector to provide your credentials and authenticate the connection to the database using one of the following methods:
Note:
The MONGO-CR authentication mechanism is deprecated as of MongoDB version 3.0.
The Simba MongoDB ODBC Connector officially supports MongoDB 3.6 through 4.2 only, but still provides limited support for the MONGO-CR authentication mechanism. If authentication through SCRAM-SHA-1 fails, the connector automatically retries authentication using MONGO-CR instead, potentially enabling connections to MongoDB 2.x.
Using SCRAM-SHA-1
You can configure the connector to use the SCRAM-SHA-1 protocol to authenticate the connection. SCRAM-SHA-1 is the default authentication protocol used by MongoDB.
Note:
If authentication through SCRAM-SHA-1 fails, the connector automatically retries authentication using the MONGO-CR mechanism instead. MONGO-CR is deprecated as of MongoDB version 3.0.
To configure SCRAM-SHA-1 authentication:
- To access authentication options, open the ODBC Data Source Administrator where you created the DSN, select the DSN, and then click Configure.
- In the Mechanism drop-down list, select MongoDB User Name and Password.
- To use a database other than the admin database to check your credentials, type the name of the database in the Authentication Source field.
- In the Username field, type an appropriate user name for accessing the MongoDB database.
- In the Password field, type the password corresponding to the user name you typed above.
- To encrypt your credentials, select one of the following:
- If the credentials are used only by the current Windows user, select Current User Only.
- Or, if the credentials are used by all users on the current Windows machine, select All Users Of This Machine.
- To save your settings and close the dialog box, click OK.
Using SCRAM-SHA-256
Note:
SCRAM-SHA-256 authentication is only supported on MongoDB version 4.0 and above.
You can configure the connector to use the SCRAM-SHA-256 protocol to authenticate the connection.
To configure SCRAM-SHA-256 authentication:
- To access authentication options, open the ODBC Data Source Administrator where you created the DSN, select the DSN, and then click Configure.
- In the Mechanism drop-down list, select SCRAM-SHA-256.
- To use a database other than the admin database to check your credentials, type the name of the database in the Authentication Source field.
- In the Username field, type an appropriate user name for accessing the MongoDB database.
- In the Password field, type the password corresponding to the user name you typed above.
- To encrypt your credentials, select one of the following:
- If the credentials are used only by the current Windows user, select Current User Only.
- Or, if the credentials are used by all users on the current Windows machine, select All Users Of This Machine.
- To save your settings and close the dialog box, click OK.
Using Kerberos
You can configure the connector to use the Kerberos protocol to authenticate the connection.
Kerberos must be installed and configured before you can use this authentication mechanism. For information about how to install and configure Kerberos, see the MIT Kerberos Documentation: http://web.mit.edu/kerberos/krb5-latest/doc/.
To configure Kerberos authentication:
- To access authentication options, open the ODBC Data Source Administrator where you created the DSN, select the DSN, and then click Configure.
- In the Mechanism drop-down list, select Kerberos.
- In the Service Name field, type the service name of the MongoDB server.
- To save your settings and close the dialog box, click OK.
Using LDAP
You can configure the connector to use the LDAP protocol to authenticate the connection.
To configure LDAP authentication:
- To access authentication options, open the ODBC Data Source Administrator where you created the DSN, select the DSN, and then click Configure.
- In the Mechanism drop-down list, select LDAP.
- In the Username field, type an appropriate user name for accessing the MongoDB database.
- In the Password field, type the password corresponding to the user name you typed above.
- To encrypt your credentials, select one of the following:
- If the credentials are used only by the current Windows user, select Current User Only.
- Or, if the credentials are used by all users on the current Windows machine, select All Users Of This Machine.
- To save your settings and close the dialog box, click OK.
- Authentication Driver Configuration Options on page 1
- Configuring SSL Verification
- Creating a Data Source Name