Eve: Building RESTful APIs with MongoDB and Flask Transcripts
Chapter: Appendix: Deploying MongoDB
Lecture: Concept: Adding authentication to MongoDB
Login or
purchase this course
to watch this video and the rest of the course contents.
0:01
Now let's see about enabling access control, we're going to connect to the shell like we have been,
0:06
again specifying the extra things like ssl, import and so on, we're going to say use the admin database
0:12
and then we want to create a user, I set the user to pwd and do not forget the roles this is very important.
0:18
Once we've done this, this doesn't magically make authentication work, we have to go over to our Mongo config
0:23
and say security authorization is enabled, then we want to talk to it, we can now pass the port, the, ssl stuff,
0:33
the users, the user name, the password- p password and authentication database is admin, don't forget that, it doesn't work without it.
0:41
At this point, you've basically set up your MongoDB in a safe way the final thing that you might consider,
0:47
and it depends on how you want to run your database and so on, and you might set up a replica set to have failover
0:53
and multi machine redundancy and things like that, that's certainly a next step that you could take
0:59
but it's beyond the scope of this course so check out the docs.