Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Authentication PockDB身份验证:创建新的CouchDB用户_Authentication_Couchdb_Pouchdb - Fatal编程技术网

Authentication PockDB身份验证:创建新的CouchDB用户

Authentication PockDB身份验证:创建新的CouchDB用户,authentication,couchdb,pouchdb,Authentication,Couchdb,Pouchdb,我使用PockDB认证插件,我喜欢它 然而,我对注册过程有点困惑,也许我没有正确使用它。我使用它在我的CouchDB数据库中创建新用户,但我不明白为什么它与特定数据库相关联?由于我在创建CouchDB用户的特定数据库之前创建了该用户,因此我必须使用虚拟数据库来创建新用户: // Create or get a database on the CouchDB server to further create a new user var remoteDB = new PouchDB('http:/

我使用PockDB认证插件,我喜欢它

然而,我对注册过程有点困惑,也许我没有正确使用它。我使用它在我的CouchDB数据库中创建新用户,但我不明白为什么它与特定数据库相关联?由于我在创建CouchDB用户的特定数据库之前创建了该用户,因此我必须使用虚拟数据库来创建新用户:

// Create or get a database on the CouchDB server to further create a new user
var remoteDB = new PouchDB('http://169.254.197.198:5984/dummy');

// Signup to this db in order to create new user in the CouchDB server
remoteDB.signUp(document.register.username.value,
  document.register.password1.value).then(function (reponse){
}).then(function (reponse) {
  // handle response
}).catch(function (error) {
  // handle error
});

问题:是否有一种独立于数据库创建新用户的方法?

这是数据库身份验证中的一个设计缺陷。从技术上讲,您的用户是相对于整个CouchDB服务器全局定义的,但是PockDB身份验证试图通过将自身附加到链接到单个CouchDB数据库的PockDB对象来简化事情


如果要继续使用PockDB身份验证,最简单的方法是使用虚拟数据库。对不起;我想不出更好的系统了/

好的,谢谢!我只是想知道我是否错过了什么嘿,诺兰!只是想知道:是否存在一些安全问题或类似的问题,禁止PockDB使用类似于:pockDB.signUp()的方法来触发对http://{my couchdb host}/_users/org.couchdb.user:{username}的PUT请求?现在我将使用虚拟数据库策略,但这确实感觉不对=/@nlawson我对Matheus Dal'Pizzol的问题也很感兴趣。目前看来,即使没有虚拟数据库,注册也能奏效。难道我不应该那样做吗?