Sample JWT Authentication in Node.js
JWTs are compact, simple and great for data transfer, authentication and authorisation. To get a basic knowledge of JWTs, go read my article here. Today, we would create a simple authentication app. For this sample, we would need a code editor (here,...
hallixon.hashnode.dev4 min read
Prafful Javare
Software Engineer
Great introduction! However I'd like to point out one thing - the standard practice is to send the JWT in the
Authorizationheader as a Bearer token, that is, the value of this header should beBearer <jwt_here>. Then we can modify the/verifyendpoint to check the Authorization header and extract the token by splitting it by space and getting the second value.