CouchDB: Requiring users of your database be valid users

So, you just created a CouchDB database, added a user to it, and want access to be limited to that user?  There is a simple way of doing this.  Let’s use a previous example, for this demo.

As you can see below, by default, you do not need to be authenticated, in order to interact with a database.

Secure Couch DB 1

 

You can use the “Configuration” tool, on the right sidebar, to do that.  If you look under “couch_httpd_auth”, there is a boolean called “require_valid_user”.  By default, the value is “false”.  You can change that to “true”.

Secure Couch DB 2

 

Once the value is set to “true”, it will require you to do an http authentication for your requests.

Secure Couch DB 3

 

This is definitely an unrefined, blunt way of securing your databases.  It works, though.

Leave a Reply

Your email address will not be published.