Using Google+ authentication on android

I want users to be able to login with their Google+ account on their android devices, and use that to sync gateway’s channels to filter each user’s data.
But I can’t see how to even begin implementing this. I had a look at the docs and watched videos. Could somebody help me here? Thanks!

For any custom authentication (G+ is in this category at the moment), effectively what you’ll want to do is set up your own webapp that handles the authentication particulars and then creates a session in Sync Gateway via the admin port. You can write that other webapp in whatever makes the most sense to you.

Have a look at the Custom Indirect Authentication section in the Sync Gateway guide.

(note: I’ve moved this to the proper category)

Oh, and since that auth may be using local code in the android app, you probably just need a secure/safe way to create that session at the webapp/SG side. My guess is there’s a way to pass something that can be validated, then create the session, then respond back to the android app.

I’m planning to deploy my Couchbase server in Azure. Is it recommended to have the custom authentication webapp to be deploy in the same VM as my Couchbase server? or can it be deployed as a separate stand-alone website or cloud service in Azure outside of the VM that hosts Couchbase Server and SG?

Hi @couchdb_user, by default the sync gateway admin port (which you need to authenticate users) is accessible only on localhost. It’s probably a good idea to leave it like that, which means, you need to deploy your custom authentication service on the same VM. You can read more here: http://developer.couchbase.com/mobile/develop/guides/sync-gateway/administering-sync-gateway/authenticating-users/index.html

Cheers,
Vlad

1 Like

Hello. This tutorial I just released might help you if it’s not too late: link. Hope that helps?

Best regards

2 Likes