You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Instead, one must apparently also pass an authSource parameter like so: app.config["MONGO_URI"] = "mongodb://{username}:{password}@{uri}:{port}/{db_name}?authSource={authSource}"
The text was updated successfully, but these errors were encountered:
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.
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}"
The text was updated successfully, but these errors were encountered: