Comment

Comment by sunir

I still don't understand the benefit of JSON Web Tokens over cookies after reading this and the associated blog post by Alberto Pose

http://blog.auth0.com/2014/01/07/angularjs-authentication-wi...

They seem like they are recreating the cookie mechanism using browser local storage and HTTP Authenticate headers, but without any of the associated browser security. I guess the use case would be when you want use a cookie across domains...?

Aren't cookies restricted for a reason? Can't anyone who can execute JS on that domain can swipe the JWT token out of storage and then impersonate the user?

One reasonable use case for JWT is to replace SAML assertions for single-sign on (SSO) from one web application to another, like Zendesk is doing:

https://support.zendesk.com/entries/23675367-Setting-up-sing...

Here, the JWT is stored not in the browser but on the server in the app trying to SSO with the identity provider (in this case Zendesk).

parent sunir 12 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton