0

Is it possible for a chrome extension to sync local database for each chrome user (pouchDB, indexedDB) over irisCouch, withoud any custom authentication service/server in the middle, just using google's logged in user (oAuth) ?

I'm trying to figure this out for days but I'm really stuck just to find out if it's possible.

I'm not sure if I'm heading in the right direction, but I imagined this kind of flow:

  1. create google identitiy, relax csp in manifest, add permission to my NAME.iriscouch.com in manifest
  2. enable CORS on iriscouch
  3. generate user's token authentication on irisCouch
  4. I will need per-user database for each chrome user to have unique data?

I can't seem to find tutorials on this matter, and I don't have the time to read 100 pages of documentation from various sources.

AstroCB
  • 12,337
  • 20
  • 57
  • 73
PathOfNeo
  • 1,089
  • 4
  • 21
  • 39

1 Answers1

1

The weak link in your plan is going to be IrisCouch. I think I may have a claim to the shortest and most definitive guide to CouchDB authentication. You say you don't have much time, but you should probably read it. ;)

Basically the problem you're going to run into is that IrisCouch (which is just CouchDB) doesn't have any APIs for creating users and giving them a database.

You will need a separate service to make this work. I.e. you will need some kind of server-side process that takes the oAuth credentials, creates a user in IrisCouch (using admin credentials!), and then gives that user a private database.

nlawson
  • 11,510
  • 4
  • 40
  • 50
  • great, i'm already reading it. So if i capture correctly, i will need to to do steps 1-3 but in step 4 i should use a solution like "Node.js Deamon" what will create the user & db in IrisCouch, after that i normally do CRUD for that user? So is it possible to install that service on my irisCouch or do i need to find another server for this service? – PathOfNeo Sep 04 '14 at 11:14
  • Yeah, you would need a separate server. I believe Cloudant and Couchbase offer built-in authentication, though, although I don't know how it works. – nlawson Sep 06 '14 at 18:42