curl -X GET -H "Authorization: Basic dG9kZGZyZWVzZTpjd2Zjd2Y=" -H "Content-Type: application/json" https://db.mydb.com:4984/mydb/7E28B6F9-0D49-4452-9E7F-8B8D5F2574E7
where dG9kZGZyZWVzZTpjd2Zjd2Y= is a base64 encode of username:password
The response I get is:
{"error":"Forbidden","reason":"forbidden"}
I know that the username and password are correctly defined in the SG.
Am I missing something here?
Todd
curl -X POST https://db.mydb.com:4985/mydb/_session -H "Content-Type:application/json" -d '{"name":"foo", "password":"bar"}'
Which returns: {"session_id":"09ff83fd94f814d100dee291ac2f5f268a9d764e","expires":"2015-10-16T13:54:48.553412097-04:00","cookie_name":"SyncGatewaySession"}
curl --cookie "SyncGatewaySession=09ff83fd94f814d100dee291ac2f5f268a9d764e" -X GET https://db.mydb.com:4984/mydb/7E28B6F9-0D49-4452-9E7F-8B8D5F2574E7
On Oct 15, 2015, at 10:47 AM, Todd Freese <to...@filmworkers.com> wrote:
curl -X GET -H "Authorization: Basic dG9kZGZyZWVzZTpjd2Zjd2Y=" -H "Content-Type: application/json" https://db.mydb.com:4984/mydb/7E28B6F9-0D49-4452-9E7F-8B8D5F2574E7
"users": {
"GUEST": {"disabled": true, "admin_channels": []},
"crashtest": {"disabled": false, "password":"crashtest", "admin_channels": ["*"]}
}
curl -X GET -H "Authorization: Basic Y3Jhc2h0ZXN0OmNyYXNodGVzdA==" http://localhost:4984/db/doc1
{"_id":"doc1","_rev":"1-cd809becc169215072fd567eebd8b8de","foo":"bar"}
Using an invalid encoded string should give the response:
{"error":"Unauthorized","reason":"Login required"}
You could validate this by using an invalid base64 encoded value.
Generally {"error":"Forbidden","reason":"forbidden"} indicates that your user does not have access to the requested document (via channel access)
On Oct 15, 2015, at 11:29 AM, ajres <an...@couchbase.com> wrote:
I tried using the base64 command on MAC OS X to encode 'crashtest:crashtest' but this gave an incompatible encoded string.
2015-10-15T17:02:13.900-04:00 HTTP: #11803: GET /shotbotdb/_design/scenes_for_job/_view/scenes_for_job?startkey=[%22-9t43hswLaiNa3qymE7MU9U%22]&endkey=[%22-9t43hswLaiNa3qymE7MU9U{}%22]&stale=false (as toddfreese)
2015-10-15T17:02:13.901-04:00 HTTP: JSON view "scenes_for_job"/"scenes_for_job" - opts map[endkey:[-9t43hswLaiNa3qymE7MU9U{}] stale:false startkey:[-9t43hswLaiNa3qymE7MU9U]]
2015-10-15T17:02:13.901-04:00 HTTP: #11803: --> 403 forbidden (0.7 ms)
As you can see, it looks like the auth part worked as it says "(as toddfreese)".
Do I need to do something different for SG design doc views?
Todd
On Oct 15, 2015, at 2:08 PM, Todd Freese <to...@filmworkers.com> wrote:
However, when I try to do a GET against a sync gateway design doc view, it does not allow it.
On Oct 15, 2015, at 2:30 PM, Todd Freese <to...@filmworkers.com> wrote:
Version 1.1. I'm using the official release. NOT build from source.
./go.sh: line 5: go: command not found
./go.sh: line 6: bc: command not found
./go.sh: line 7: go: command not found
*** Go 1.3 or higher is required to build Sync Gateway; you have
Please visit http://golang.org/doc/install or use your package manager to upgrade.
I see that GCC for CGO is required and can't seem to find any info via googling.
Todd
On Oct 16, 2015, at 7:49 AM, Todd Freese <to...@filmworkers.com> wrote:
Do you guys do nightly builds or anything like that?
On Oct 16, 2015, at 11:56 AM, Todd Freese <to...@filmworkers.com> wrote:
FYI, I had to re-submit my view design docs to the SGs for this to work. Do these views get stored in the backing db? In my case it is couchbase.