Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

persona and custom authentication #9

Open
deefactorial opened this issue Jun 7, 2014 · 2 comments
Open

persona and custom authentication #9

deefactorial opened this issue Jun 7, 2014 · 2 comments

Comments

@deefactorial
Copy link
Contributor

Any plans to implement persona or custom authentication in the TodoLite example app ?
Persona does not have lists of friends to share things with but tasks could be shared by email for persona.

for custom authentication could I just login to my server using coax like this:

    var url = REMOTE_LOGIN_URL;
    coax.get(url, function(err, data) {
        if (err) {return cb(err)}
        log("Server Login Data:", data)
        cb(false, data)
    }) 

which would set the session cookie for the domain.
Would successive requests to the sync_gateway succeed because the cookie is set?

@tleyden
Copy link
Contributor

tleyden commented Jun 9, 2014

Any plans to implement persona or custom authentication in the TodoLite example app ?

Yep, this was omitted due to time constraints, not because we don't want it. Contributions welcome!

Would successive requests to the sync_gateway succeed because the cookie is set?

With iOS, that might work, as long as the sync gateway is running on the same host as the sync gateway (or uses a proxy trick). With Android, that won't work, and you'll need to explicitly set the cookie via Replication.setCookie, which is unfortunately currently not exposed via the REST API for a phonegap app to call (but it could be)

/cc @jchris -- any thoughts on this?

@deefactorial
Copy link
Contributor Author

I found that if basic authentication credentials are used for the REMOTE_SYNC_URL I was able to sync the databases, for server authentication the user could log into the servers custom authentication then use basic authentication for each successive REST request. I'm re-writing the TodoLite-Phonegap app to enable server authentication using basic authentication.

Does anyone know how to set the basic authentication header of a coax request ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants