On Apr 28, 2010, at 10:33 AM, Bharat wrote:
> I am trying to use jcouchdb api for authenticating against my couchdb
> instance(0.11). I have set the admin usr/pass in futon and in addition
> specified ADMIN and READER on the DB I am trying to access so only people
> with correct credentials can access/view the DB.
>
> My code is pretty simple and directly using ServerImpl and its
> setCredentials and get method:
>
> -------------------------
> ServerImpl service = new ServerImpl("localhost");
> Credentials credentials =
> new UsernamePasswordCredentials(<usr>, <pass>);
> AuthScope authScope = new AuthScope("http://localhost", 5984);
>
> service.setCredentials(authScope, credentials);
>
> Response res = service.get(/<database>);
> -----------------------------
>
> But everytime I do this, I keep getting http 401 in my response. Is there
> something I am missing or not setting correctly?
>
If you can give us the logs from CouchDB (at debug level) or an HTTP-level
transcript of what's happening, we can probably help better with debugging.
Chris
> I know its not exactly a couchdb question but there is very little to no
> documentation available so thought I ll try here.
>
> Thanks!