Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd support for the authentication source parameter #34
Comments
rspeed
referenced this issue
Dec 13, 2013
Closed
Added support for the source parameter when authenticating #36
This comment has been minimized.
This comment has been minimized.
Steps to verify and test:
Similar steps may also be taken to verify that |
This comment has been minimized.
This comment has been minimized.
blade2005
commented
Feb 10, 2017
@rspeed did you ever come up with a way around this? Obviously this wasn't implemented and seeing as how it's been open for over 3 years at this point I doubt it will be. |
blade2005
referenced this issue
Feb 10, 2017
Merged
Adding support for auth source and auth mechanism #88
This comment has been minimized.
This comment has been minimized.
Nah, I don't even remember what I was using this for. |
This comment has been minimized.
This comment has been minimized.
tcco
commented
Feb 14, 2017
Quite unfortunate this is not an added feature. Here is the workaround. Order of operations: Not ideal, would appreciate a cleaner solution. |
This comment has been minimized.
This comment has been minimized.
#88 fixed this, and will be released as part of the upcoming 0.5.0 release. |
rspeed commentedDec 12, 2013
To prevent the duplication of authentication data across databases, MongoDB has two mechanisms to delegate authentication to a specific separate database. Both use a specific key in the
system.users
collection, but act in the opposite direction. The first method is theotherDBRoles
key in theadmin
database. The value names both the table that receives authentication and the roles assigned to the user. The other method is theuserSource
key, which goes in any database and simply refers to another database with the same user.For both methods, when the client authenticates, it has to do so against the other database –
admin
for the first method, the named DB in the other. To accomplish this in PyMongo, asource
parameter is included when callingMongoDB.authenticate
.Adding support for this feature should be fairly straightforward. IT requires the addition of a new config value with a name like
PREFIX_SOURCE
, as well as parsing theauthSource
URI parameter. That value is then passed to the authentication method, and that's all there is to it.