Skip to content

jbenezech/couch_jwt_token

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

couch_jwt_token

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.

Requirements

  • Couchdb 1.6.1
  • couch_jwt_auth

Installation (taken from 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}

Test with Curl

curl --data "name=USERNAME&password=PASSWORD" http://localhost:5984/_token

Response

HTTP/1.1 200 OK
{"ok":true,"id_token":"JWT_TOKEN"}

TODO:

  • tests
  • store tokens in DB
  • refresh token

Licence:

Apache v2.0 license.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published