You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Doug <do...@gmail.com> on 2010/11/03 09:43:17 UTC
Auth guide error?
Hm..
Reading:
http://guide.couchdb.org/draft/security.html
Suggestion is that you you can:
curl -X PUT $HOST/_config/admins/doug -d '"secret"'
But I get:
1> [info] [<0.1556.0>] 127.0.0.1 - - 'PUT' /_config/admins/doug 400
1> [debug] [<0.1556.0>] httpd 400 error response:
{"error":"bad_request","reason":"invalid UTF-8 JSON"}
On the other hand, I can do this:
curl -X PUT $HOST/_config/admins/doug -d '"{'doug' : 'secret'}"'
...but then I get:
1> [info] [<0.2050.0>] 127.0.0.1 - - 'PUT' /_config/admins/doug 500
1> [debug] [<0.2050.0>] httpd 500 error response:
{"error":"unknown_error","reason":"badarg"}
So, question is, what's the right syntax here?
Looking at the 'fix this' actions, I see:
1> [debug] [<0.2202.0>] 'PUT' /_config/admins/doug {1,1}
Headers: [{'Accept',"application/json, text/javascript, */*"},
{'Accept-Encoding',"gzip, deflate"},
{'Accept-Language',"en-us"},
{'Connection',"keep-alive"},
{'Content-Length',"8"},
{'Content-Type',"application/json; charset=UTF-8"},
{'Host',"127.0.0.1:5984"},
{"Origin","http://127.0.0.1:5984"},
{'Referer',"http://127.0.0.1:5984/_utils/config.html"},
{'User-Agent',"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4;
en-us) AppleWebKit/533.18.1 (KHTML, like Gecko)"},
{"X-Requested-With","XMLHttpRequest"}]
1> [debug] [<0.2202.0>] OAuth Params: []
1> [info] [<0.2202.0>] 127.0.0.1 - - 'PUT' /_config/admins/doug 200
...but I can't figure out how to see what actually got sent along with that
request as content...
~
Doug.