AuthenticationDatabase
- Last Updated: September 20, 2021
- 1 minute read
- DataDirect Connectors
- JDBC
- MongoDB 6.1
- Documentation
Purpose
Specifies the database in which your user ID was created. In MongoDB, you can create the same user ID in different databases with unique permissions. This property ensures that the driver authenticates with the correct version of the user ID when using user ID and password authentication (AuthenticationMethod=userIdPassword).
Valid Values
string
where:
string
is the name of the database in which your user ID was created.
Notes
-
AuthenticationDatabase is used only for user ID and password authentication (
AuthenticationMethod=userIdPassword). To ensure the correct permissions are used for your connection, it's recommended that you specify a value for AuthenticationDatabase when user ID and password authentication is enabled. -
If you do not specify a value for this property, the driver attempts to use your user ID with the database specified by the Databasename property. If your user ID was not created in the specified database, the driver will attempt to connect to the Admin database using your user ID and password.
Data Source Methods
public String getAuthenticationDatabase()
public void setAuthenticationDatabase(String)
Default Value
No default value
Data Type
String