Skip to content

Use default authdb when connecting to MongoDB

Compare
Choose a tag to compare
@stefanbethke stefanbethke released this 27 Apr 10:11
· 84 commits to main since this release
357b08f

Previously, the connection string always had the target databases specified as the defaultauthdb (the last part of the connection string). Older versions of the MongoDB driver ignored this, and the authentication was performed against the admin db. With the current version of the Java drive, the field is honored, and the authentication fails, as there are no authentication object in the target database.

Now, no defaultauthdb is specified, and the authentication is performed against the server default.