Express middleware for the jwt-central authentication service.
// Initialize the jwt-central-client with the host params for the jwt-central server
jwtCentralClient.init('localhost', 8000);
// Example API endpoint that shows the current decoded jwt
app.get('/api/jwt', jwtCentralClient.auth, function (req, res) {
res.json(req.jwt);
});
npm install
cd example
npm install
After modifying the configuration parameters in app.js
:
cd example
node app.js
npm install -g mocha
mocha
npm install -g jshint
jshint index.js
jshint example
jshint test