couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jens Alfke <j...@couchbase.com>
Subject How does OAuth support, or custom headers, work in the replicator?
Date Sat, 19 May 2012 00:54:51 GMT
There's a small bit in the wiki* that hints at a replication JSON parameter to set custom headers.
One of the examples of a _replicate request shows the body:

> {"source":{"url":"https://example.net:5984/db","headers":{"Authorization":"Basic Ym9iQGV4YW1wbGUuY29tOnBhc3N3b3Jk"}},
"target":"local-db"}

There's no further explanation; could someone clarify whether the 'headers' property can be
used to add arbitrary HTTP headers to the requests sent by the replicator?

A few paragraphs later is the statement:

> Using a JSON hash (instead of a plain string) may also be used to specify OAuth (by adding
a "oauth" field to the hash).

I don't understand this at all ('oauth' isn't an HTTP header, so does this mean to add it
as a top-level property in the _replicate body? Or somewhere else? And what should its contents
be?

I'd like to know how OAuth is used to authenticate to CouchDB, but there's almost nothing
about it in the wiki.

—Jens

* http://wiki.apache.org/couchdb/Replication
Mime
View raw message