Open arnoutaertgeerts opened 10 years ago
Good question. I'm planning on addressing this with https://github.com/redgeoff/factoryng/issues/14. Please stay tuned.
On Sat, Sep 27, 2014 at 8:57 AM, arnoutaertgeerts notifications@github.com wrote:
I want to use the pouchdb-authentication https://github.com/nolanlawson/pouchdb-authentication to handle authentication on my website and ensure only authenticated users can alter the data. This plugin handles authentication by setting an authentication cookie with each pouchdb request.
I have used this plugin successfully to handle the authentication on my app which used angular-pouchdb https://github.com/wspringer/angular-pouchdb as a direct client to the remote database.
Would it be possible to use pouchdb-authentication with your pouchdb implementation? I think this would be a great extra feature to the Pouchyng factory.
If you think this is beyond the scope of your project, I'm happy to help if you can guide me in the right direction :)
— Reply to this email directly or view it on GitHub https://github.com/redgeoff/factoryng/issues/29.
I also asked the owner of the pouchdb-authentication plugin how this setup would work when you login to a CouchDB instance and use the same credentials for different PouchDB databases syncing with different CouchDB databases on the same instance here.
Note that pouchdb-authentication only works with the http/https adapter so my guess is that the sync()
function needs some rewriting.
@arnoutaertgeerts I just released a new version with #31 that has the adapter constructor instantiate the provider. So, you can now do:
var contacts = new Pouchyng('contacts', 'https://pouchyng.iriscouch.com', yngutils.ASC);
and then access the provider with contacts.provider()
before you would issue
contacts.bind($scope);
I know this doesn't directly address your problem, but it's a step in the right direction. I'm still working on your particular issue and will most likely include examples illustrating how to use pouchdb-authentication
.
@redgeoff I also submitted an issue on the pouchdb-authentication
repo.
The plugin stores a cookie in the browser which is send with every request. I haven't tried it yet but I think if you login to your instance, using for example another factory, this should just work with factoryng.
So authentication might even work without getProvider()
.
I want to use the pouchdb-authentication to handle authentication on my website and ensure only authenticated users can alter the data. This plugin handles authentication by setting an authentication cookie with each pouchdb request.
I have used this plugin successfully to handle the authentication on my app which used angular-pouchdb as a direct client to the remote database.
Would it be possible to use pouchdb-authentication with your pouchdb implementation? I think this would be a great extra feature to the Pouchyng factory.
If you think this is beyond the scope of your project, I'm happy to help if you can guide me in the right direction :)