New to MongoDB, trying to figure out how permissions work.
My PHP code connects to Mongo just fine:
$mongo = new MongoClient('mongodb://admin:password@localhost');
return $mongo->selectDB('admin');
I can also do this from shell:
# mongo -u admin -p password admin
MongoDB shell version: 3.0.5
connecting to: admin
However, an attempt to connect to Mongo from other remote host using the same credentials (Windows, in this case) results in:
Failed to authenticate admin@admin with mechanism MONGODB-CR: AuthenticationFailed MONGODB-CR credentials missing in the user document
I am trying to configure Robomongo admin tool to manage MongoDB instance.
Obviously, I've allowed connections to Mongo server by updating IP binding directive.
It looks like "admin" user is not allowed to connect from a host other than localhost - MySQL has exactly the same parameter.
The question: how do I allow admin user to connect from outside the box?
Thanks!