Skip to content

Latest commit

 

History

History
19 lines (10 loc) · 1.02 KB

File metadata and controls

19 lines (10 loc) · 1.02 KB

OAuth

OAuth Flows - Playground

JWT Nice Readout

JWTs are self-describing Bearer tokens.

Two major drawbacks of JWT are stale tokens and the inability to expire them on-demand.

Stale tokens

If the role of your user changes, it will not be reflected in the issued token. You will need to issue a brand new one. Ideally, you would expire the one before, which brings us to the next problem.

No on-demand expiry

JWTs cannot be expired on demand as they are themselves stateless. An approach to solve this is JWT blacklisting, but that will kill your server's statelessness. This also means that your user cannot essentially log out of your application since you cannot invalidate tokens on-demand.

About the short lived tokens. If the attacker is in possession of a short lived token, he can just query your API to "keep it alive" for as long as you let him (8 hours or 1 day).