-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
My app uses multiple databases. I'd like to authenticate with a user stored in the admin db that has readWriteAnyDatabase permissions.
Currently, my mongoid.yml looks something like this:
production:
sessions:
default:
hosts:
- my.mongo.com:27017
database: default_db
username: admin_user
password: admin_pw
The problem is that Mongoid will authenticate with admin_user@default_db instead of admin_user@admin. So authentication always ends up failing
I'd like to keep default_db as my default database, but I'd also like to authenticate with admin_user@admin. Is there a good way to accomplish this?
(Here's someone else dealing with the same issue)