New api user - npolar/api.npolar.no GitHub Wiki

As Step 0 in the Publishing guide, here's how you create a new API user

You need a user with the role sysadmin for the system api to create/modify users. (This means that the first sysadmin user needs to be injected into your user storage directly.)

Passwords are stored salted, Base64-encoded, SHA1-hashed in ssha_password.

Assign roles in a system using a Hash with an Array or roles: "roles":{"system1":["editor"]}

curl -nXPUT https://api.example.com/user/user1.json [email protected]
{"_id":"user1","_rev":"1-1e35b2e11307a8102629968599e532bb","id":"user1","email":"[email protected]","name":"User One","type":"person","groups":["group1","group2"],"roles":{"system1":["editor"],"system2":["editor"]},"ssha_password":"***************************************************"}

~/.netrc (for curl)

The above curl command works with the -n switch, pulling passwords from your chmod 600'ed ~/.netrc

machine api.example.com login username1 password password1
machine couchdb.example.com login username2 password password2