【问题标题】:Angular with CouchDB Cookie Authentication 401Angular 与 CouchDB Cookie 身份验证 401
【发布时间】:2015-01-25 23:46:07
【问题描述】:

我想使用 CouchDB cookie 身份验证登录到我的 Angular 应用程序。

第一步是创建一个管理员帐户,然后如果 cookie 验证有效,则尝试 CURL。

我在 curl 上发帖

curl -vX POST 127.0.0.1:5984/_session -H 'Content-Type: application/x-www-form-urlencoded' -d 'name=foo&password=bar'

结果出来了

http://i.stack.imgur.com/j23hU.jpg

是的,用户名和密码正确

用户是由“Futon 的设置管理员”创建的(我应该寻找不同的用户名和密码吗?)

cors 已启用

原点设置为 *

提前谢谢

【问题讨论】:

    标签: angularjs authentication curl cookies couchdb


    【解决方案1】:

    在屏幕截图中查看最后一行:'password' is not recognizes as an external or internal command...。在 Windows 上,您需要使用双引号来转义特殊字符,而不是单引号,或者将 & 写为 ^&

    【讨论】:

      【解决方案2】:

      不是名字而是用户名。

      curl -vX POST 127.0.0.1:5984/_session -H 'Content-Type: application/x-www-form-urlencoded' -d 'username=foo&password=bar'
      

      【讨论】:

      • 我的错,不知道使用用户名也可以使用
      猜你喜欢
      • 2014-07-28
      • 1970-01-01
      • 1970-01-01
      • 2015-12-16
      • 2011-09-21
      • 2011-06-24
      • 1970-01-01
      • 2018-05-06
      • 2016-10-02
      相关资源
      最近更新 更多