Use default authdb when connecting to MongoDB
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.