|
JS Client |
Browser
|
Header
|
Authorization: Bearer <JWT>
|
Cookie: token=<JWT>
|
Transmission |
manual coding; works with any CORS domain |
automatically sent; not possible across domains
|
Storage
|
- web storage: accessible only from current subdomain; 5MB limit
- cookie storage: accessible from subdomains; 4kB limit
- other options that are available to JavaScript
|
cookie storage only
|
MITM |
TLS must be managed by code |
secure cookie flag forces TLS
|
XSS |
manual coding effort |
implicit with HttpOnly cookie flag to prevent JS access
|
CSRF |
— |
manual coding effort (double sumit cookie)
|