Security 与_会话的身份验证
我目前正在尝试使用couchdb“会话”机制。我(ofc)读到:和 但我无法登录。因此,我漫游了一段时间,找到了像和这样的文章,以及一些这样的帖子 下面是我所做的: 我创建了我的用户数据库并添加了一个用户(totolol:foobar): 但是,无论我如何尝试登录:Security 与_会话的身份验证,security,authentication,couchdb,Security,Authentication,Couchdb,我目前正在尝试使用couchdb“会话”机制。我(ofc)读到:和 但我无法登录。因此,我漫游了一段时间,找到了像和这样的文章,以及一些这样的帖子 下面是我所做的: 我创建了我的用户数据库并添加了一个用户(totolol:foobar): 但是,无论我如何尝试登录: curl -vX POST http://org.couchdb.user:totolol:foobar@bachman:8889/_session curl -vX POST http://bachman:8889/_sess
curl -vX POST http://org.couchdb.user:totolol:foobar@bachman:8889/_session
curl -vX POST http://bachman:8889/_session -d 'name=totolol&password=foobar'
...
我总是得到相同的结果,401响应,其中包含以下消息:
{"error":"unauthorized","reason":"Name or password is incorrect."}
我不知道我做错了什么,也许我的配置坏了,但我卡住了。所以我希望你们中的一位能告诉我该怎么做 使用
curl
,使用您给出的第二个示例:
curl -X POST http://username:password@server:5984/_session -d 'name=totolol&password=foobar'
这绝对是正确的程序。我已经在CouchDB v1.1.0上确认了这一点。您将用户名“totolol”与文档“org.CouchDB.user:totolol”混淆了
如果您使用“totoolol:foo@”,它应该可以正常工作。您创建了一个用户数据库吗?CouchDB已经有了“#users”DB,如果您对用户使用了不同的DB,那么您必须在local.ini文件中更改适当的参数。Ok,在与#CouchDB上的人交谈后,问题似乎来自我的安装(我有一个相当旧的CouchDB版本),因为它与他们配合得很好。
curl -X POST http://username:password@server:5984/_session -d 'name=totolol&password=foobar'