Skip to content

Conversation

@chewbranca
Copy link

Quick patch to add in basic auth support.

Also added in a helper function genDB.

@elfsternberg
Copy link
Owner

Chewbranca, I can't find a corresponding API for this in Nano that matches what you've done here. Everything I'm reading about CouchDB recommends logging in through an account that's capable of working with databases, storing the cookie generated by the log-in pass, and then performing the necessary operations using the cookie as the authentication token. Can you comment on why you chose your method?

@chewbranca
Copy link
Author

@elfsternberg basic auth is the most direct form of authentication with CouchDB, and is a very common access pattern. http://wiki.apache.org/couchdb/Security_Features_Overview

I don't use Nano but this change works fine for user based authentication with CouchDB through grunt-couchapp.

@rnewson
Copy link

rnewson commented Jan 29, 2013

I strongly recommend getting and reusing an AuthSession cookie as a best practice. Future versions of CouchDB will ship with stronger (slower) authentication mechanisms that can be configured with a work factor.

@chewbranca
Copy link
Author

Bump.

This is a couchapp tool for uploading ddocs, so it should really only be making a handful of requests at a time.

Using user:pass@host is standard couchapp procedure as described here: http://couchapp.org/page/couchapp-config.

@elfsternberg any chance we could get this merged in? Deployments to CouchDB servers with auth are currently broken without this.

@bnfinet
Copy link

bnfinet commented Mar 28, 2013

Thanks @chewbranca for adding basic auth!

I've started using the add-basic-auth branch from your forked repository and it seems to be working fine.

I do hope this feature is merged into the main branch.

And thank you @elfsternberg for helping us all grunt out our couchapps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants