0

We're moving and updating our database because it's due for it, but we have an issue concerning authentication. We'd like to connect to the database only with an authentication key.

Our old CouchDB were not using any user and all the databases were public (no users permissions or anything like it). It was working but it is not what we want.

Now, with our 'new' CouchDB, we'd like to have our connections made with an authentication key only, but it looks like there's an expiration on the sessions made and we can't find the way to have a token permanent.

For the context, I'm using couchdb-python for my tools and I found some ways to start a session and get the cookies, therefore the authentication key, but either it is via couchdb-python or the web platform (Fauxton I think it's called), the expiration time is still there and after the timeout (as shown below) the session does expire.

Below is our local.ini for it. We tried to add both required_valid_user = false and allow_persistent_cookies = true but to no avail.

[couchdb]
uuid = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

[couch_peruser]

[chttpd]
port = 5984
bind_address = 192.168.140.66
require_valid_user = false

[httpd]

[couch_httpd_auth]
require_valid_user = false
secret = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
allow_persistent_cookies = true
timeout = 600

[ssl]

[vhosts]

[admins]
admin = -xxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,xx

I'm pretty sure there's something we're overlooking or that we did not understand correctly.

Is there a way to get an authentication key to be permanent?

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189

1 Answers1

1

Is there a way to get an authentication key to be permanent?

The best would just be to use password authentication. The password never changes (unless you change it, of course).

But if you insist on using a token, you can increase the session timeout to some insane value:

[couch_httpd_auth]
timeout = 99999999999999

This is untested. I don't know what the maximum value is.

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189