javascript - NodeJS creating JWT no third party libraries -
can point me in right direction on how jwt auth in nodejs using no third party libraries. i'm making own express fun learn node can , want bare bones nodejs.
here have far (basic server), if show me how create jwt , how read jwt , other cool things jwts think might me along learning path, love forever.
(function(){ var http = require("http"); const port = process.env.port; const host = process.env.ip; function requester(req,res){ if(req.url == "/createbatmanjwt"){ //create jwt res.end("yay created jwt"); } if(req.url == "/readbatmanjwt"){ //read jwt res.end("yay read jwt"); } } var server = http.createserver(requester); server.listen(port, host, function(){ console.log("server on"); }); })();
thanks!!!
there lot of work involved creating , verifying jwts, aka rfc7519, not recommend trying create own code unless have lot of time put testing it. njwt - wrote it, i'm biased :)
Comments
Post a Comment