I have a site on foo.com serving PageA .
PageA has some jQuery inside it that requests through XmlHttpRequest some JSON data from the CouchDb instance located at bar.com .
As I understand it, the same origin policy prevents this, but using JSONP should circumvent this limitation (CORS will eventually cover this use case).
The foo.com server has a reliable connection to the bar.com database.
Is it possible to authenticate a user with foo.com using their OAuth credentials (for example, to log in to Twitter) and then use bar.com for authentication? (I believe this is not due to the fact that the authentication cookie is only read by foo.com .)
Given this, is it possible to authenticate the user in any way to use CouchDB at bar.com from foo.com using any of the available authentication mechanisms for CouchDB (OAuth, cookie, and Basic)?
Edit: Can I, for example, return the user credentials for bar.com from foo.com (extracted via my trusted link), which are then set on the client side in the XmlHttpRequest HTTP header for basic authentication with bar.com . Of course, everything is done using TLS (... or is it a security nightmare?)
source share