dmunch / couch_jwt_auth Goto Github PK
View Code? Open in Web Editor NEWThis project forked from softapalvelin/couch_jwt_auth
JSON Web Token (JWT) authentication plugin for CouchDB
License: Apache License 2.0
This project forked from softapalvelin/couch_jwt_auth
JSON Web Token (JWT) authentication plugin for CouchDB
License: Apache License 2.0
Would be nice to have a description of why is this fork.
I came to it cause I hear it is CouchDB 2+ compatible.
First, thanks a million for porting this to Couch 2. I don't know jack about erlang, and I can't get Couch 1.6 running on Debian Stretch, so without this I would have been stuck. Although it compiled and installed, it kept throwing
{"error":"noproc","reason":"{gen_server,call,[couch_jwt_auth,{get_jwk}]}"}
whenever I tried to authenticate. From what I could tell, start_link was never being called, and so the get_jwk call failed. Digging through the other parts of Couch 2 (in particular, couchdb-b64url), I saw that it began with an "on_load" call (in that case, to init/0). I added
- on_load(start_link/0).
after the module() line at the top of couch_jwt_auth.erl, and it seems to work fine now.
I'm just leaving this as an issue, rather than a pull request, because 1) I don't know what I'm doing with erlang, and this is just a sufficiently successful hack for me, and 2) it breaks a bunch of tests (and again, my erlang-less-ness stopped me from fixing them).
I hope this helps, and again, thanks a bunch!
I'm having trouble adding the plugin. The handler doesn't get picked up. I did set plugin_dir
. I'm not sure what structure the dir should have, I simply have built couch_jwt_auth
folder in there.
It's pretty hard to find any info about plugins on 2.0 online, so any help would be appreciated.
Line https://github.com/dmunch/couch_jwt_auth/blob/master/src/couch_jwt_auth.erl#L124 fails silently, when there is an error loading a public key the plugin , resulting in an empty list of keys (even hs_secret).
Suggested resolution: Put a try/catch around it and write something and use LOG_INFO to write to logging.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.