Apache CouchDB http://couchdb.apache.org supports authentication and authorization functionalities. This functionality comes in handy when setting up a production server or when you need to restrict (anonymous) users.
Cloudant also supports authentication https://github.com/cloudant/sync-android#authentication making it easier to connect and authorize opensrp-client application.
Below are the steps required to configure this security functionality: -
Create a new Admin user
For example, creating a system admin with "anna" as the username and "secret" as the password.
> HOST="http://127.0.0.1:5984" > curl -X PUT $HOST/_config/admins/anna -d '"secret"' ""
System admin is allowed to do anything to a CouchDB installation.
Confirm that the new system admin has been created successfully
Without credentials
> curl -X PUT $HOST/somedatabase {"error":"unauthorized","reason":"You are not a server admin."}
With credentials
> HOST="http://anna:secret@127.0.0.1:5984" > curl -X PUT $HOST/somedatabase {"ok":true}
Add Comment