Monday, 8 May 2017

Authentication Failed Mongoose

I'm trying to enable auth into my mongo server. I've already done:

-Configured security into mongo.conf

-Created the users(if use it with mongo -u -p..... from console works fine)

In the node server js my config is this

mongoose.connect(mongodb://user:pass@localhost:27017/dbName);

Alse I've already tried with

mongoose.connect(mongodb://user:pass@localhost:27017/dbName,{auth:{authdb:"admin"}});

And this

mongoose.connect(mongodb://user:pass@localhost:27017/dbName,{auth:{authdb:"dbName"}});

And always get this error:

Authentication failed

What would be doing wrong?



via Hanzo

No comments:

Post a Comment