Skip to content
This repository was archived by the owner on May 4, 2023. It is now read-only.

pass-through authentication #151

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

jalpedersen
Copy link

Hi again,

I've added a very simple database authentication step based on an earlier discussion we had. When a request hits C-L, a get request is sent to underlying CouchDB database to verify that the user indeed has read access to it. This works by copying all headers from the original request onto the request going to CouchDB. By blindly copying all headers it works both for basic auth, cookies and what not. Note, that this uses an HttpClient, which does not use the credentials provided in couchdb-lucene.ini.

The rest of C-L continues to use the original httpClient, so there is no real change to the underlying flow of things, only a simple authenticating step is added (which perhaps could be made optional?)

@rnewson
Copy link
Owner

rnewson commented Feb 22, 2012

It's a bit ugly but I coded up my thought here: https://github.com/rnewson/couchdb-lucene/compare/authenticate_users.

@jalpedersen
Copy link
Author

Yes, but your approach would only verify that the user is in fact a user in the CouchDB instance - not that he/she has access to the database being searched in (in the event that read-access has been limited to certain users/roles), which is the problem I'm trying to solve.

Also, your approach assumes that basic auth is being used, which is not always the case, especially when dealing with CouchApps for instance. Also, it will not work when deployed as a war to another servlet-container.

Your approach would be good for more general things, such as limiting access to the admin functionality to certain roles for instance.

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

Successfully merging this pull request may close these issues.

2 participants