toraritte / knowledge-gaps

All the stuff I don't know, but would like to (or should)
0 stars 0 forks source link

JSON Web Tokens (JWT), Cookies and Bearer Tokens #19

Open toraritte opened 6 years ago

toraritte commented 6 years ago

https://jwt.io/introduction/

When should you use JSON Web Tokens?

Here are some scenarios where JSON Web Tokens are useful:

  • Authentication: This is the most common scenario for using JWT. Once the user is logged in, each subsequent request will include the JWT, allowing the user to access routes, services, and resources that are permitted with that token. Single Sign On is a feature that widely uses JWT nowadays, because of its small overhead and its ability to be easily used across different domains.

The above describes authorization use cases (and this is already fixed on jwt.io site's repo, but the page hasn't caught up yet).

toraritte commented 6 years ago

https://stackoverflow.com/questions/37582444/jwt-vs-cookies-for-token-based-authentication This entire thread is pretty good, but add on the to-do list to read the RFCs for Cookies and Bearer Tokens:

Bearer Tokens: https://tools.ietf.org/html/rfc6750

Cookies: https://tools.ietf.org/html/rfc6265

toraritte commented 6 years ago

This Stackoverflow thread is also nice info on cookies. Mentions an interesting paper: A Secure Cookie Protocol.