I used JWT to protect my node.js REST api calls. I used below code to generate the token:
jwt.sign({ foo: 'bar' }, private_key, { algorithm: 'RS256'}, (err, token) => {
res.json({
token
});
But I don't get any token with when I use the algorithm: 'RS256'. But above code works with algorithm: 'HS256'.
Do you know a solution?