Skip to content

Instantly share code, notes, and snippets.

@motin
Created November 20, 2012 08:16
Show Gist options
  • Save motin/4116696 to your computer and use it in GitHub Desktop.
Save motin/4116696 to your computer and use it in GitHub Desktop.
_session - Name or password is incorrect
$ curl -XPUT -d '{
"_id": "org.couchdb.user:foobar1",
"name": "foobar1",
"type": "user",
"roles": [],
"password": "plaintext_password"
}' http://host:port/_users/org.couchdb.user:foobar1
{"ok":true,"id":"org.couchdb.user:foobar1","rev":"1-feed66a63c5cf324addc54b81314de34"}
$ curl -XPOST -d "{ name: 'foobar1', password: 'plaintext_password' }" http://host:port/_session
{"error":"unauthorized","reason":"Name or password is incorrect."}
$ curl -XGET http://host:port/_users/org.couchdb.user:foobar1
{"_id":"org.couchdb.user:foobar1","_rev":"1-9e9a6a2afdbb3d7954ce8e237016e59b","name":"foobar1","type":"user","roles":[],"password_sha":"db750756b9d062a81e573e812d6d9f52a2c5e3e5","salt":"fe4eb466c2c32155c722d6a70080cb76"}
$ curl -XPOST -d "{ name: 'foobar1', password: 'plaintext_password' }" http://foobar1:plaintext_password@host:port/_session
{"error":"unauthorized","reason":"Name or password is incorrect."}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment