<https://lh5.googleusercontent.com/-GTbZK7iFnic/VIGocewCLXI/AAAAAAAAAhI/bdaRspfewro/s1600/Untitled.png>
On Friday, 5 December 2014 00:07:10 UTC+5:30, Traun Leyden wrote: > > Can you post your sync gateway config? > > Also, I would suggest disabling guest access, so that way you know whether > it's using the session cookie or not (if it's not, it will get an error > trying to do a replication) > > On Thu, Dec 4, 2014 at 3:40 AM, Vinay Bhinde <[email protected] > <javascript:>> wrote: > >> Hello All, >> >> I would like to tell you what we have done till now... >> >> I am using couchbase lite on IOS and android along with sync gateway. For >> authentication i use Nodejs api which is running on the *same host as >> the sync gateway but on different port.* >> I call nodejs api when user taps login button which gets me a session >> from gateway and i return the session cookie header in response from nodejs >> to client. Now while setting up replication properties in app for sync i >> explicitly define "header" object with "Cookie" property so that CBLite >> recognizes the session and user while making calls to SG. >> >> I do the same in case of IOS app. The replication and syncing runs fine >> on android but i am facing issues on IOS. The issue is that even if i >> create a document with channel A and user A signed in on android, user B >> with access to channel B using the app on IOS and logged in receives that >> document which should not be the case. I have doubts if the session cookie >> i generate is used by CBLite for making calls to Sg because the user on ios >> is receiving all the documents regardless of any channel. >> >> Any help is appreciated. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Couchbase Mobile" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/mobile-couchbase/4828e271-b45f-4e3a-8268-753b531675b1%40googlegroups.com >> >> <https://groups.google.com/d/msgid/mobile-couchbase/4828e271-b45f-4e3a-8268-753b531675b1%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > my config json file { "log": ["CRUD", "REST+"], "databases": { "budgetappdb": { "server": "http://localhost:8091", "bucket": "sync_gateway", "users": { "GUEST": {"disabled" : false} }, "sync":`function(doc,oldDoc){if (doc._deleted) {requireUser(oldDoc.channels);return;}if(!doc.channels){throw({forbidden: "Missing required properties"});}if(oldDoc==null){requireUser(doc.channels)}else{requireUser(oldDoc.channels);}channel(doc.channels);access(doc.channels,doc.channels);}` } } } Replicate request header on IOS {"target":"budgetappdb","headers":{"Cookie": "SyncGatewaySession=238aa5d0b66d9588559756eb91c5427509a8c69a"},"source":{ "url":"http://192.168.1.14:4984/budgetappdb","auth":{"name":"vinay"}}, "continuous":true} Currently even though i login from IOS and Android with same credentials, i do not get documents which i create on android on IOS but the reverse works fine. Please ignore the original post regarding ios device receiving all documents.Simply stating there is no pull at ios..just the push. i am posting a screenshot of sync gateway server logs <https://lh5.googleusercontent.com/-GTbZK7iFnic/VIGocewCLXI/AAAAAAAAAhI/bdaRspfewro/s1600/Untitled.png> -- You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/6522782d-edb2-4b76-93ba-f3b1476a8c94%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
