[
https://issues.apache.org/jira/browse/COUCHDB-1479?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15063693#comment-15063693
]
Alexander Harm commented on COUCHDB-1479:
-----------------------------------------
h4. Setup
# I installed CouchDB via brew:
{noformat}
brew install couchdb
{noformat}
# In local.ini living at
{noformat}
/Users/<username>/Library/Application Support/CouchDB/etc/couchdb/local.ini
{noformat}
I added
{noformat}
[couch_httpd_auth]
require_valid_user = true
{noformat}
h4. Editing Config File Directly
# Edit local.ini living adding the following
{noformat}
[httpd]
WWW-Authenticate = Basic realm="App"
{noformat}
# Starting CouchDB
# CouchDB lower-cased my entry to
{noformat}
www-authenticate = Basic realm="App"
{noformat}
# CouchDB replies to failed auth requests to _session with the default header
{noformat}
WWW-Authenticate: Basic realm="server"
{noformat}
h4. Editing via Futon
# Go to Futon > Tools > Configuration
# Add a new section
{noformat}
section: httpd
option: WWW-Authenticate
value: Basic realm="App"
{noformat}
# In Futon the entry is displayed correctly
# In local.ini the entry is displayed correctly as
{noformat}
WWW-Authenticate = Basic realm="App"
{noformat}
# Restart CouchDB
# In local.ini the entry changed to
{noformat}
www-authenticate = Basic realm="App"
{noformat}
# Same in Futon
h4. Editing Via API
# PUT to _config
{noformat}
curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X PUT
'http://user:[email protected]:5984/_config/httpd/WWW-Authenticate' -d '"Basic
realm=\"App\""'
{noformat}
# In Futon the entry is displayed correctly
# In local.ini the entry is displayed correctly as
{noformat}
WWW-Authenticate = Basic realm="App"
{noformat}
# Restart CouchDB
# In local.ini the entry changed to
{noformat}
www-authenticate = Basic realm="App"
{noformat}
# Same in Futon
Does that suffice or do you need more information?
> Futon config UI won't allow "WWW-Authenticate" option to be added (name is
> lowercased)
> --------------------------------------------------------------------------------------
>
> Key: COUCHDB-1479
> URL: https://issues.apache.org/jira/browse/COUCHDB-1479
> Project: CouchDB
> Issue Type: Bug
> Components: Futon
> Environment: Mac OS X
> Reporter: Jens Alfke
> Priority: Minor
>
> When using the config UI in futon to add a new option, via the "Add a new
> section..." link at the bottom of the page, the name of the option is
> lowercased when written to the .ini file. (For some reason the case is
> preserved when altering the runtime configuration, though, so the problem
> doesn't manifest itself until the next time the server is restarted.)
> This causes trouble when attempting to enable HTTP basic auth by adding a
> "WWW-Authenticate" option (value "Basic") to the [httpd] section. The actual
> data written to the .ini file is:
> [httpd]
> www-authenticate = Basic
> which is not recognized when the server loads its configuration on restart.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)