Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set default database as auth source for mongodb connection #410

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

notz
Copy link
Contributor

@notz notz commented Nov 3, 2022

This change may break some configurations, but it seems that the default database is used for authentication also on other drivers. On the other hand, without that change it's not possible to connect to a mongodb where the authdb isn't the "admin" db.

This change may break some configurations, but it seems that the default database is used for authentication also on other drivers.
On the other hand, without that change it's not possible to connect to a mongodb where the authdb isn't the "admin" db.
@janproch
Copy link
Member

janproch commented Nov 3, 2022

I think better option will be to set authSource explicitly in database URL, if you need this. I am afraid this will break DB connection on most of mongo databases.

I have tested it on simple MongoDB with authentization, and it failed on auth error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants