Configuring OAuth 1.0 authentication using _users database
Configuring OAuth 1.0 authentication using config file
Enable _users db to authenticate using OAuth
curl -X PUT http://admin:supersecret@172.17.0.1:5986/_config/couch_httpd_oauth/use_users_db -d '"true"'
"true"
Create admin user record
curl -X PUT http://admin:supersecret@172.17.0.1:5986/_users/org.couchdb.user:admin -d "{ \"type\": \"user\", \"name\": \"admin\", \"password\": \"supersecret\", \"roles\": [\"admin\"], \"oauth\": { \"consumer_keys\": { \"6ab4ddd1ce65f6381cef17e0fbfefd66757440488530275fc085b51edb06f834\": \"a723486eaaac5906a834b19881961a36865f43aa560b8d5877ace1d771e6ddd4\" }, \"tokens\": { \"f4e4ef1e10be83fa872c24cd52f116671c9da29dc54273caa2b22190d2df9712\": \"d45c84d26c56af1e02ea20e400c4f78e90c3caa1f9600e20199f8418112b9260\" } }}"
{"ok":true,"id":"org.couchdb.user:admin","rev":"1-b2389e2b70e62cf00cd1ddfea305c2d2"}
Saved document
{
"_id": "org.couchdb.user:admin",
"_rev": "1-b2389e2b70e62cf00cd1ddfea305c2d2",
"value": {
"rev": "1-b2389e2b70e62cf00cd1ddfea305c2d2"
},
"key": "org.couchdb.user:admin",
"doc": {
"_id": "org.couchdb.user:admin",
"_rev": "1-b2389e2b70e62cf00cd1ddfea305c2d2",
"type": "user",
"name": "admin",
"roles": [
"admin"
],
"oauth": {
"consumer_keys": {
"6ab4ddd1ce65f6381cef17e0fbfefd66757440488530275fc085b51edb06f834": "a723486eaaac5906a834b19881961a36865f43aa560b8d5877ace1d771e6ddd4"
},
"tokens": {
"f4e4ef1e10be83fa872c24cd52f116671c9da29dc54273caa2b22190d2df9712": "d45c84d26c56af1e02ea20e400c4f78e90c3caa1f9600e20199f8418112b9260"
}
},
"password_scheme": "pbkdf2",
"iterations": 10,
"derived_key": "b5e61fa88fec9205c1a533dba455a702a9e8d255",
"salt": "1fd5a7b508c6f5950059c3a10cad550d"
}
}
Comments
Post a Comment