JSON Web Tokens (JWT) with Restify

Sean Wragg
Sean’s Blog
Published in
3 min readJun 18, 2017

--

This is a very simple example of signing and verifying JSON Web Tokens using Restify. If you’d like more information on either subject, check out the following links:

https://jwt.io/introduction/

Getting Started

First, we’ll need to install a few dependencies

$ npm i --save restify restify-jwt-community jsonwebtoken

As a sidenote: we could just as easily accomplish this without the use of extra middleware. However, restify-jwt-community (forked from auth0/express-jwt), provides us with a simple interface and drops a req.user property for quick reference.

Second, we’ll start with a very basic restify server:

--

--