Couchdb authentication using second server

Detailed information seems to be hard to find on this. So the situation I have is an existing server with usernames and passwords. I'm adding an additional couchdb server to manage data for a mobile app, however I still want all authentication to be handled via the existing server. So I can send an HTTP request with username and password to the existing server and i can get it to send back anyanything i like if access is accepted. How could I then use that information to authenticate with the couchdb server? I imagine it would be possible to recieve a secret from the existing server on successful authentication that we could match to one we have manually stored on couchdb server. However that doesn't seem to be very secure.

I have read the Authentication docs at couchdb but I'm still confused. Any suggestions for an authentication system?


I think JWT authentication is what you're looking for. There's a plugin which can do this for you: https://github.com/dmunch/couch_jwt_auth (The repository is a fork, implementing additional functionality to the original one plus is compatible with CouchDB 2.0.)

Basically you send your username/password to the authentication server, which in turn gives you back a token (the JWT). You can now authenticate to CouchDB using this token. CouchDB verifies the integrity of the token either by using a shared secret (HS256) or by using the public key of the authentication server.

链接地址: http://www.djcxy.com/p/81154.html

上一篇: 当月份发生变化时加载fullcalendar事件

下一篇: 使用第二台服务器的Couchdb认证