Thursday, 4 May 2017

Authorization fail to MongoDB Atlas from Node.JS

I am trying to connect to my mongoDB atlas cluster but get an authentication fail. I am able to connect from a client like Studio 3T and from the Mongo shell.

Here's my connection URI:

var conn = mongoose.connect("mongodb://<user>:<password>@xxx-shard-00-00-kqmqb.mongodb.net:27017,xxx-shard-00-01-kqmqb.mongodb.net:27017,xxx-shard-00-02-kqmqb.mongodb.net:27017/myDB?ssl=true&replicaSet=xxxCluster-shard-0&authSource=admin")

I copied this from the atlas console. I'm using Mongoose 4.9.7 which uses MongoDB 2.2.26 so I'm using the latest versions of these modules.

The error I get is the following:

MongoError: authentication fail

Any idea what this could be?



via Passero

No comments:

Post a Comment