In all the node js examples given, to validate the access_token, we use the express-jwt middleware. But how do we validate the access token in case of applications that do not use express, like aws lambda.
// create timesheets API endpoint
app.post(‘/timesheets/upload’, checkJwt, function(req, res){
var timesheet = req.body;
// Save the timesheet entry to the database…
//send the response
res.status(201).send(timesheet);
})
Above is how all examples use in express. But I have a handler in aws lambda like this:
handler: (event, context, callback) => {
// handling code here
// event.headers would contain the appropriate access token in appropriate header
}
So how do I validate the access token in such case? Are there any libraries that will help?