WEB(AngularJS), Android(Native), IOS(Native)


#1

I’m planning to build an application that runs on WEB(AngularJS), Android(Native), IOS(Native). I have experience with MongoDB, but I found CouchBase which sounds really good for me. I read documentation and I found out I need to use sync_gatway to sync my mobile databases with main database server and reverse, until now everything is fine. I also need to use “channels” to share records with multiple users.

The problem comes when I need to implement this for web application. In documentation on “Working with web applications” docs explain how “bucket shadowing” is working, but also say:

Bucket shadowing is meant to enable sync for existing Couchbase Server apps. If you are creating a new app with both mobile and web clients, we recommend starting with the Sync Gateway REST APIs, and connecting backend services using the Changes Worker Pattern.

After reading Sync Gateway REST API I found out I’m limited to facebook and persona authentication. So I can’t use my own authentication mechanism? Also, there is nothing specified in REST API about channels? Is there any example project or more documentation about this? I couldn’t find anything :frowning:

For my own auth I migh make a nodejs rest call, but how about channels pull?

If someone has experience with this, please explain how this works.


#2

Sync Gateway isn’t limited to Facebook and Persona. It supports both HTTP Basic and cookie/session auth using its own user account database. You can also set up custom authentication if you have your own auth system (like LDAP) already.


#3

Also, there is nothing specified in REST API about channels?

Channels don’t interact much with the REST API directly. They’re used in the Sync Gateway to route documents to users and set up access controls. At the API level once the client authenticates it will be able to see only the documents in the channels it has access to.

The admin REST API does allow you to configure what channels user accounts have access to, using the /db/_user/username endpoint.