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

Better authentication documentation? #142

Open
UNIcodeX opened this issue Jun 1, 2020 · 1 comment
Open

Better authentication documentation? #142

UNIcodeX opened this issue Jun 1, 2020 · 1 comment

Comments

@UNIcodeX
Copy link

UNIcodeX commented Jun 1, 2020

After nearly 2 hours trying to figure out how to get authentication working with this module, the solution was finally realized, that when using authentication, merely passing the connection string as the following was not sufficient.

app.config["MONGO_URI"] = "mongodb://{username}:{password}@{uri}:{port}/{db_name}"

Instead, one must apparently also pass an authSource parameter like so:
app.config["MONGO_URI"] = "mongodb://{username}:{password}@{uri}:{port}/{db_name}?authSource={authSource}"

@dcrosta
Copy link
Collaborator

dcrosta commented Jun 2, 2020

Sorry to hear that -- it must be frustrating. I'd welcome a change to the docs to make this clearer. The important point to emphasize is that we pass the connection URI directly to PyMongo, so all behavior about interpretation of the connection string is determined by PyMongo itself. If you'd like to update the docs, please do include a link to https://pymongo.readthedocs.io/en/stable/examples/authentication.html which has examples and details about the behavior.

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

No branches or pull requests

2 participants