Skip to content
This repository has been archived by the owner on Feb 10, 2023. It is now read-only.

Unable to connect with mongodb standard URI or connect using db other than 'admin' #5

Open
rudolf opened this issue Feb 12, 2014 · 4 comments

Comments

@rudolf
Copy link

rudolf commented Feb 12, 2014

Tayra seems to always want to authenticate using 'admin' which makes it impossible to authenticate using db level users stored in .system.users .

It's also not possible to use the mongodb standard URI to connect to a db.

@DhavalDalal
Copy link

I think prima-facie it sounds like MongoDB thing as Tayra simply forwards the creds to MongoDB, but I'll ask the team to take a look into this. We will get back to you.

Also, it would be nice, if you could give us the steps to reproduce. Thanks!

@viveksd87
Copy link

Hi,
I think currently Tayra authenticates credentials only for "admin" database.
What we need to do is accept the "database" as well to authenticate against.

@rudolf
Copy link
Author

rudolf commented Feb 13, 2014

I managed to hard code it for my own use, but I haven't done enough groovy to attempt a pull request for a generic solution.

It might be helpful to look at the documentation for mongooplog: http://docs.mongodb.org/manual/reference/program/mongooplog/

"By default, mongooplog assumes that the database specified to the --db argument holds the user’s credentials, unless you specify --authenticationDatabase."

@sameersoni
Copy link
Contributor

Hi Rudolf,
I went through the issue, and --authenticationDatabase is introduced from 2.4 onwards. We are planning to introduce --authDb as a command line argument, which will take in the value for DB where credentials are stored.
For backward compatibility, ie for version below 2.4, we will keep --authDb parameter, and if user provides say '--authDB "someDB"', then too credentials will be looked for in 'admin' database.
For version >= 2.4, user will be authenticated using the authDb he specified.
Does this sounds good?

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

No branches or pull requests

4 participants