Kerberos authentication
- Last Updated: July 30, 2025
- 2 minute read
- DataDirect Connectors
- ODBC
- MongoDB 8.0
- Documentation
Note: The strings
demonstrated in this section use the DSN-less format. For additional formats, see "Using a
connection string."
This string includes the options used to connect with Kerberos authentication.
DRIVER=DataDirect 8.1 MongoDB;AuthenticationMethod=4;DatabaseName=database;
HostName=hostname;PortNumber=port;ServicePrincipalName=principal_name;
User=user_name;[attribute=value[;...]];
where:
- database
-
(optional) specifies the name of the database to which you want to connect. This value is used as the default qualifier for unqualified table names in SQL queries.Note: This value is case-insensitive if you have access privileges to query the list of databases on the server. If you do not have access, this value is case-sensitive.
- hostname
- the name or the IP address of the server to which you want to connect. For example, myserver.
- port
-
specifies the port number of the server listener. The default is
27017.
- user_name
- (optional) specifies the user name that is used to connect to the MongoDB database. For example, jsmith.
- principal_name
- (optional) if the default value built by the driver does not match
the service principal name registered with the KDC, specify the three-part service
principal name. By default, the driver builds the ServicePrincipalName by concatenating
the service name
mongodb, the fully qualified domain name (FQDN) as specified with the HostName property, and the default realm name as specified in the Kerberos configuration file.
- attribute=value
- specifies connection option settings. Multiple option attributes are separated by a semi-colon.
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 example connection string includes the options required for connecting with LDAP authentication:
DRIVER=DataDirect 8.1 MongoDB;AuthenticationDatabase=4;DatabaseName=mydb;
HostName=myserver;PortNumber=27017;User=jsmith;