Lurker News

Comments (249) 36 threads

Earlier comments
belyakov#
If you choose to use JWTs I suggest still keeping a database of tokens and validate against that. This way you have an option to revoke the token and force client to get a new one. This is useful for when token data becomes stale, e.g. email changed, roles added etc. Simply keeping it all in token is not enough.
sidchilling#
I think that Auth Tokens are easy to understand, use, and implement. They can generally be invalidated if the developer feels that they have been compromised.

Some APIs also use self-invalidating auth tokens based on an expiry date. For more secure data, I'd prefer that.

niwde1 reply#
Use Access-control-allow-origin and set it to only allow calls from a specific address.
ssudaraka2 replies#
Can someone fake the origin?
fimdomeio#
This is controlled on browser level and most (all?) browsers implement this. Origin can be faked by just using anything that can make a http request, like curl. It exists to protect users not the server.
askthrowaway#
from browser ? No. from non-browser clients like curl ? Yes. And your server will never be able to tell if it is fake or not
darkhorn#
Client side SSL certifikate or digest authentication or basic acces authentication.

Load more comments