Request handler to generate JSON Web Token after user authentication using CouchDB authentication database.
Token generated by this handler can be parsed by couch_jwt_auth.
- Couchdb 1.6.1
- couch_jwt_auth
For compiling and installing the plugin, see couch_jwt_auth
Note:
On Ubuntu, the plugins directory is: /usr/lib/couchdb/plugins
Couchdb default.ini config:
[httpd]
vhost_global_handlers = ... , _token
[httpd_global_handlers]
_token = {couch_jwt_token, handle_session_req}
curl --data "name=USERNAME&password=PASSWORD" http://localhost:5984/_token
Response
HTTP/1.1 200 OK
{"ok":true,"id_token":"JWT_TOKEN"}
- tests
- store tokens in DB
- refresh token
Apache v2.0 license.