You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Daniel Gonzalez <go...@gonvaled.com> on 2014/01/16 17:37:43 UTC

Keep several couchdb sessions authenticated

Hi all,

During development I am using several couchdb servers. Some tasks
(verifying the status of the server in futton, for example), can only be
performed while authenticated. To improve my workflow during developement,
I have increased the session timeout, so that I do not neet to authenticate
too often. I do not want to completely disable authentication since some of
my couchdb servers are exposed.

My workflow (and my problem) is the  following:

1) Authenticate to server A
2) verify something in server A
3) Authenticate to server B
4) verify something in server B
5) go back to verify something in server A <--- ERROR: the session to
server A has been lost!! I need to re-authenticate

In my case the servers are accessible via tunnels:
- localhost:5984 for server A (the local couchdb)
- localhost:60001 for server B (a remote couchdb)

I guess couchdb is using a cookie for the session without keeping
information about the endpoint, so it gets overwritten.

Is there a workaround for this, so that I do not need to re-authenticate so
often?

BR,
Daniel

Re: Keep several couchdb sessions authenticated

Posted by Daniel Gonzalez <go...@gonvaled.com>.
Mmmm. I think your suggestion is a valid workaround. I'll have to try that.

Thanks!


On Thu, Jan 16, 2014 at 10:42 PM, Jens Alfke <je...@couchbase.com> wrote:

>
> On Jan 16, 2014, at 8:37 AM, Daniel Gonzalez <go...@gonvaled.com>
> wrote:
>
> > I guess couchdb is using a cookie for the session without keeping
> > information about the endpoint, so it gets overwritten.
>
> It's not possible, apparently, to have port-specific cookies for the same
> host:
>
> http://stackoverflow.com/questions/1612177/are-http-cookies-port-specific
> So if you connect to two CouchDB servers at the same hostname, the auth
> cookies they set are going to overwrite each other.
>
> > Is there a workaround for this, so that I do not need to re-authenticate
> so often?
>
> Don't configure the tunnels to be on the same hostname?
>
> —Jens

Re: Keep several couchdb sessions authenticated

Posted by Jens Alfke <je...@couchbase.com>.
On Jan 16, 2014, at 8:37 AM, Daniel Gonzalez <go...@gonvaled.com> wrote:

> I guess couchdb is using a cookie for the session without keeping
> information about the endpoint, so it gets overwritten.

It's not possible, apparently, to have port-specific cookies for the same host:
	http://stackoverflow.com/questions/1612177/are-http-cookies-port-specific
So if you connect to two CouchDB servers at the same hostname, the auth cookies they set are going to overwrite each other.

> Is there a workaround for this, so that I do not need to re-authenticate so often?

Don't configure the tunnels to be on the same hostname?

—Jens

Re: Keep several couchdb sessions authenticated

Posted by Daniel Gonzalez <go...@gonvaled.com>.
I mean "Whatever action that needs authentication" :)

Actually, I wanted to check the status of a view update, which in my big
database takes a long time. But it is not really important: the problem is
the same with any action done via futton which requires authentication.



On Thu, Jan 16, 2014 at 5:45 PM, Aurélien Bénel <au...@utt.fr>wrote:

> Hi Daniel,
>
> > Some tasks (verifying the status of the server in futton, for example),
> can only be performed while authenticated.
>
> Just to be sure... What do you mean exactly by "the status of the server"?
> Replication status? View building status? Or just that the server is alive
> ?
>
>
> Regards,
>
> Aurélien

Re: Keep several couchdb sessions authenticated

Posted by Aurélien Bénel <au...@utt.fr>.
Hi Daniel,

> Some tasks (verifying the status of the server in futton, for example), can only be performed while authenticated. 

Just to be sure... What do you mean exactly by "the status of the server"?
Replication status? View building status? Or just that the server is alive ?


Regards,

Aurélien