<legend id='XL6Lg'><style id='XL6Lg'><dir id='XL6Lg'><q id='XL6Lg'></q></dir></style></legend>

    • <bdo id='XL6Lg'></bdo><ul id='XL6Lg'></ul>
    1. <tfoot id='XL6Lg'></tfoot>
    2. <small id='XL6Lg'></small><noframes id='XL6Lg'>

      1. <i id='XL6Lg'><tr id='XL6Lg'><dt id='XL6Lg'><q id='XL6Lg'><span id='XL6Lg'><b id='XL6Lg'><form id='XL6Lg'><ins id='XL6Lg'></ins><ul id='XL6Lg'></ul><sub id='XL6Lg'></sub></form><legend id='XL6Lg'></legend><bdo id='XL6Lg'><pre id='XL6Lg'><center id='XL6Lg'></center></pre></bdo></b><th id='XL6Lg'></th></span></q></dt></tr></i><div id='XL6Lg'><tfoot id='XL6Lg'></tfoot><dl id='XL6Lg'><fieldset id='XL6Lg'></fieldset></dl></div>

        Couchdb 使用用户名和密码同步访问

        时间:2023-11-01

        <small id='i4gIv'></small><noframes id='i4gIv'>

        1. <i id='i4gIv'><tr id='i4gIv'><dt id='i4gIv'><q id='i4gIv'><span id='i4gIv'><b id='i4gIv'><form id='i4gIv'><ins id='i4gIv'></ins><ul id='i4gIv'></ul><sub id='i4gIv'></sub></form><legend id='i4gIv'></legend><bdo id='i4gIv'><pre id='i4gIv'><center id='i4gIv'></center></pre></bdo></b><th id='i4gIv'></th></span></q></dt></tr></i><div id='i4gIv'><tfoot id='i4gIv'></tfoot><dl id='i4gIv'><fieldset id='i4gIv'></fieldset></dl></div>

                <tbody id='i4gIv'></tbody>
              • <tfoot id='i4gIv'></tfoot><legend id='i4gIv'><style id='i4gIv'><dir id='i4gIv'><q id='i4gIv'></q></dir></style></legend>
                  <bdo id='i4gIv'></bdo><ul id='i4gIv'></ul>
                  本文介绍了Couchdb 使用用户名和密码同步访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一个在虚拟 linux 机器上运行的 couchdb.该数据库已启用并设置了 cors.我添加了一个管理员用户和数据库的密码.我也将 require_valid_user 设置为 true.我正在尝试使用以下代码将网页中的 pouchdb 与在线 couchdb 同步.如果我只是通过地址对于 db(下面的 1),我得到一个对话框,询问用户和密码.同步在此示例中有效.如果我尝试在 URL 中传递用户名和密码(如下面的 2 所示),我会收到同步错误和消息getCheckpoint 被拒绝".任何关于我做错了什么或我应该采取的其他方法的建议将不胜感激.

                  I have a couchdb running on a virtual linux machine. This db has cors enabled and setup. I have added an admin user and password to the db. I also have require_valid_user set to true. I am trying to sync a pouchdb in a web page with the couchdb online with the code below. If I just pass the address for the db (1 below), I get a dialog box asking for a user and password. The sync works in this example. If I try to pass the user name and password in the URL (as in 2 below), I get a sync error and the message "getCheckpoint rejected with ". Any suggestions on what I am doing wrong or another approach I should taking with this would be greatly appreciated.

                  谢谢

                  附:我可以使用用户名和密码浏览到 URL.

                  P.S. I am able to browse to the URL with the user and password.

                  var remoteCouch = "http://192.168.1.7:5984/mydb";  //1
                  //var remoteCouch = "http://userid:password@192.168.1.7:5984/mydb"; //2
                  sync();
                  
                  function sync() {
                    var opts = {live: true};
                    db.sync(remoteCouch,opts,syncError);
                  }
                  

                  推荐答案

                  我在尝试同步到 cloudant.com 上的 couchDB 时遇到了同样的问题.对我来说,解决方案是在远程服务器的 URL 中使用 https://而不是 http://.URL 的格式应该是:

                  I had the same problem with the exact same error message trying to sync to a couchDB on cloudant.com. For me, the solution was to use https:// instead of http:// in the URL of the remote server. The format of the URL should be:

                  https://<api_key>:<key_passwd>@<username>.cloudant.com/<db_name>

                  因此,尽管我没有本地安装的数据库来测试这一点,但我怀疑您的错误源于当您提供凭据时沙发将请求重定向到安全连接的事实(场景 1).而在场景 2 中不会发生重定向.

                  So although I do not have a locally installed DB to test this, I suspect your error stems from the fact that couch redirects the request to a secure connection when you provide your credentials (scenario 1). While in scenario 2 no redirect occurs.

                  这篇关于Couchdb 使用用户名和密码同步访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Chart.js - 如何将数组集合推送到数据集中 下一篇:{async:false} 如何在 jQuery AJAX 请求中工作?

                  相关文章

                    <bdo id='RUAGa'></bdo><ul id='RUAGa'></ul>

                  1. <tfoot id='RUAGa'></tfoot>

                  2. <small id='RUAGa'></small><noframes id='RUAGa'>

                    <i id='RUAGa'><tr id='RUAGa'><dt id='RUAGa'><q id='RUAGa'><span id='RUAGa'><b id='RUAGa'><form id='RUAGa'><ins id='RUAGa'></ins><ul id='RUAGa'></ul><sub id='RUAGa'></sub></form><legend id='RUAGa'></legend><bdo id='RUAGa'><pre id='RUAGa'><center id='RUAGa'></center></pre></bdo></b><th id='RUAGa'></th></span></q></dt></tr></i><div id='RUAGa'><tfoot id='RUAGa'></tfoot><dl id='RUAGa'><fieldset id='RUAGa'></fieldset></dl></div>

                    <legend id='RUAGa'><style id='RUAGa'><dir id='RUAGa'><q id='RUAGa'></q></dir></style></legend>