Report this

What is the reason for this report?

MongoDB Authentication, what URI should I use ?

Posted on November 2, 2015

Hello,

I set username and password to mydatabase and can access with the following URI URI ‘mongodb://username:password@ip:27017/mydatabase’

Now I want to protect the access to my MongoDB Server with Authentication=True with UserDB and password

For that, I use MongoChef to set the Authentication, User name and password What is the URI that I should use to access mydatabase ?

I use KeyStoneJS on docker, MongoDB on Docker and NGINX on Docker for my website.

Thank You Kosona



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hello,

The URI shouldn’t change with a modification such as this. As you still access it the same way, you just require authentication now.

Is that giving you issues? If so, what are the errors you are getting? It’s important to understand when asking for help to provide as much information as you can when looking for help. Otherwise we do not have the tools needed to replicate and help you.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.