Error creating user in CouchDB 1.0

后端 未结 4 612
执笔经年
执笔经年 2021-02-10 08:13

My system is ubuntu 10.04 and I have CouchDB 1.0 installed. I can create admin, or more admins, log in as admin and everything works fine.

Since 0.11 in CouchDB there i

4条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-10 08:55

    To create a user, PUT a JSON document to http://localhost:5984/_users/org.couchdb.user:

    For example create a file login.json like this:

    {
        "_id": "org.couchdb.user:test",
        "name": "test",
        "password_sha": "24e8e07c23d8ae85108468ec4814b2f0fa84edde",
        "salt": "78f67e252351a56d6e1e6df9ba005239",
        "roles": [],
        "type": "user"
    }
    

    Then PUT the data into couchdb:

    curl -X PUT http://:@localhost:5984/_users/org.couchdb.user%3Atest -S -s -H "Content-Type: application/json" -d @login.json
    

    (Replace and with your couchdb credentials.)

    Now you should be able to log into couchdb with the user "test" and the password "test123".

提交回复
热议问题