Skip to content

Instantly share code, notes, and snippets.

@steadicat
Created August 11, 2009 16:47
Show Gist options
  • Save steadicat/165952 to your computer and use it in GitHub Desktop.
Save steadicat/165952 to your computer and use it in GitHub Desktop.
// from local.ini
[couch_httpd_auth]
authentication_db = users
require_valid_user = true
// http://localhost:5984/users/_design/_auth/_view/users
{"total_rows":1,"offset":0,"rows":[
{"id":"users","key":"stefano","value":{"password_sha":"EwPfA3e1xccq6zn5M0qUp6141hU=","roles":["_reader","_writer","_admin"],"seed":"1234"}}
]}
// from the Erlang shell
2> couch_util:encodeBase64(crypto:sha(["1234", "test"])).
<<"EwPfA3e1xccq6zn5M0qUp6141hU=">>
> curl http://stefano:test@localhost:5984/
{"error":"unauthorized","reason":"Name or password is incorrect."}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment