3 ms·
> I can't think of any real world scenarios where a JWT is superior to cookie auth over HTTPS. What if you aren't using a browser? What if you explicitly want
by mooreds 6y ago
> I can't think of any real world scenarios where a JWT is superior to cookie auth over HTTPS.
What if you aren't using a browser? What if you explicitly want to know that the contents of the auth token aren't modified? What if you want to work with a IdP that only provides JWTs to offer centralized authentication and user management?
> Cookie auth is much easier to implement without the need for a 3rd party library and is also more secure.
As long as you are in the browser, sure! In many cases you can use secure cookies and server side sessions and they work well. But as soon as you get into more distributed or larger systems, reaching out to multiple APIs, JWTs may make sense.
- dchest 6y agoWhat if you aren't using a browser? There's no difference between browser authentication via a cookie and app authentication via a token. The cookie stores the session token, the app store the session token. What if you explicitly want to know that the contents of the auth token aren't modified There is no content in an auth token — it's a random number. What if you want to work with a IdP that only provides JWTs to offer centralized authentication and user management? When there's no choice, there's no choice.