-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 2.1.1
-
Component/s: None
-
None
Hello,
I am having trouble connecting to a remote server with simple authentication. It was working with moped and now that I've switched to mongodb driver it does not work. Here is what I do :
#ruby
client = Mongo::Client.new([ 'somehost:someport' ], :database => 'some_db', username: "some_user", password: "some_password")
client.collections
#returns
Mongo::Error::OperationFailure: not authorized for query on some_db.system.namespaces (13)
Whereas when I do the equivalent using mongodb shell :
#shell
mongo somehost:someport
use some_db
db.auth("some_user", "some_password")
db.system.namespaces.find() #equivalent to `show collections`
#results
list of collections
The remote server runs MongoDB 2.6.11