I setup a local parse-server, it is working perfectly fine except when I enable authentication in MongoDB and change connection string to mongodb://username:password@localhost:27017/dbname
, the parse console throw the following error:
unable to ensure uniqueness for usernames mongoerror authentication failed
The client i.e. RoboMongo works fine too, with authentication. I even tried with a user that has both userAdminAnyDatabase
and dbAdminAnyDatabase
roles assigned to it just to ensure it is not a permission issue.
Update: I was using MongoDB 3.2 so I tried to downgrade to MongoDB 3.0.12, still the same issue.
Update 2:
I even tried root
role which has the highest privilege i.e. superuser but still no luck.
Have you created a user for the specific database? If you try to connect using the mongo admin account you can experience this.
Create a user like this:
use dbName
db.createUser({ user: "userName", pwd: "password", roles: [ "readWrite", "dbAdmin" ] })
and use that to connect to the database - then it should work
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With