Create a token, put your userId in it, set an expiry date. If a request comes with a token check if token is valid, check the userId & expiry date otherwise throw error.
I would suggest everyone to stay away from jwt unless they're willing to spend the time to learn how it works.
I believe the meta is that jwt is solid itself but allows doing things "wrong". Guardrails so to speak are insufficient if not outright lacking. I'd say just go with plain text token for a web app. I don't like the idea of trusting the client because I don't understand how jwt works.
Some libraries don't make it easy (or possible) to check that the algorithm used by the JWT sent by the client is in fact the algorithm you're using and want the client to come back with, see i.e. https://auth0.com/blog/critical-vulnerabilities-in-json-web-...
Comments (249) 36 threads
Earlier commentshttp://page.rest does a good job.
Create a token, put your userId in it, set an expiry date.
If a request comes with a token check if token is valid, check the userId & expiry date otherwise throw error.
I believe the meta is that jwt is solid itself but allows doing things "wrong". Guardrails so to speak are insufficient if not outright lacking.
I'd say just go with plain text token for a web app. I don't like the idea of trusting the client because I don't understand how jwt works.
Continue this thread — 1 reply
I am interested to know whether HN thinks this is considered secure?
All comments shown.
Couldn't load more comments. Check your connection and try again.