CouchDB replication with authentication and validation update handler

When using a validation update handler, one must use user_ctx when running the replication as an admin user. When using HTTPS and authentication on the remote database, one must use headers.

  "_id": "Replicate provisioning from",
  "source": {
    "url": "",
    "headers": {
      "Authorization": "Basic dXNlcjpwYXNzd29yZA=="
  "target": "provisioning",
  "continuous": true,
  "user_ctx": {
    "name": "admin",
    "roles": [
  "owner": "admin",

Note: with roles to include depend on which roles are used by the validation function(s).

Written on January 27, 2015