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

authSource (--authenticationdatabase) #211

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion django_mongodb_engine/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ def pop(name, default=None):
raise ImproperlyConfigured, exc_info[1], exc_info[2]

if user and password:
if not self.database.authenticate(user, password):
if not self.database.authenticate(user, password, source=options.get('authsource')):
raise ImproperlyConfigured("Invalid username or password.")

self.connected = True
Expand Down
5 changes: 4 additions & 1 deletion docs/source/reference/settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ Additional flags may be passed to :class:`pymongo.MongoClient` using the
'NAME' : 'my_database',
...
'OPTIONS' : {
'socketTimeoutMS' : 500,
'slave_okay' : True,
'tz_aware' : True,
'network_timeout' : 42,
'authSource': 'authentication_database_name'
...
}
}
Expand Down