Important thing to remember, is that when an user logs out, the JWT is still usable. The log out process just removes it from client cookies/local storage. So unless the server application has implemented token blacklisting on logout, a malware can still use the jwt till it expires.
@M3t4lstorm11 ай бұрын
Sure if you don't implement it properly, but that goes for everything, so...
@EtailaxiA11 ай бұрын
How about just add a table call "signout_jwt" on db, add it on the table when user signout, than check when log in, if find that is on the db than reject the sign in. After the jwt is timeout, than delete it from the db 🤔
@imsergiohere11 ай бұрын
Not with OpenID wich exposes a /logout endpoint. Also, JWT MUST MUST MUST be used to identify YOU, but not to AUTHORIZE you. system: OK so you say that you are Sandipb, let me check and I will store your sesssion if true. OK, this is you, nice, I'm going to check that you are authorized to do this. OK, go for it. Next time I will not go to identity server to check your token, they can callback me if you logout.
@backdownhipi10 ай бұрын
This is why its best to only allow a jwt a 5 minute window, at which point a new jwt needs to be authed before more api use.
@fcnealvillangca794310 ай бұрын
@@backdownhipi isn't this will make your user log in every 5 minutes? I still don't get the essence of refresh token for this
@rasmusjensen821911 ай бұрын
This is a good intro to JWTs. Although, I do think that JWT, oauth and oidc is being somewhat mixed together. JWT's does not necessarily provide authorization or authentication. JWT is just a standard for signing JSON claims.
@wovasteengova10 ай бұрын
So can we set a time on the User when they log out so that if a request comes in and we validate that the user is logged in. First. But there would have to way to store JWT on db huh.
@ReflectionOcean11 ай бұрын
- Understand JWT structure and usage (0:34) - Ensure sensitive payload data is encrypted (2:02) - Choose the right signing algorithm for your needs (2:17) - Implement best practices for JWT security (4:02)
@neeleshsalian191211 ай бұрын
It amazed me when I heard it is pronounced as "jot"
@kjyu453911 ай бұрын
that is disgusting 😡
@pineappl3pizzzasoju11 ай бұрын
For me: json => JAY-SONG(silent G) jwt => J.W.T
@sourabhmunjal38304 ай бұрын
It’s actually pronounced JOT in programming world
@calebracey28 күн бұрын
This is by far the best description of the pros cons and implications of JWT use and the different flavours that i have seen. Balanced simple and factual
@alananisimov16 күн бұрын
Nice short and informative video. Nice to hear an explanation of under-the-hook work of JWT's and comparison with Session-based auth. Thanks for the video!
@animanaut11 ай бұрын
one antipattern i witnessed is to put stuff into the payload that would rather belong into a rest path. like a for example GET for a particular resource where the resource key/resource had to be provided via payload instead of rest path. there is potential for missuse like that too, not only security.
@Jen-kx3oh9 ай бұрын
technically accurate but low effort video. also doesn't really address the title, explaining why there is popularity over other mechanisms (any relationship to sessions, cookies, etc would be a good start). would have appreciated more detail on why token revocation is "difficult", key management, different types of claims (you're really just gonna say what one of them is, and just vaguely??), any examples of weak vs strong hashing algorithms, the baseline assumption that this is all over https, etc, i could go on.. and i don't believe adding any of this would drastically increase the video length or complexity, considering the graphical density.. wish some of the animation was used for any of these things.
@maratchardymov269011 ай бұрын
Nice video, but I'd love to see comparison with cookies, for example cookies are used as default session store in Rails and can be stateless as JWT
@aakarshan464411 ай бұрын
cookies are difficult in case of microservice authentication
@ldelossantos11 ай бұрын
The cookies are good for browsers, they are handle automatically by then, and modern implementation allows you to hide the cookie from JS for example, avoiding for example to allow somene to stole your session with script injection flaws. But JWT is really easy to implement in any layer, APIs are not only between your browser and your server, are also server trough server, if you try to handle cookies in your server code you will realize the difference.
@OverG8811 ай бұрын
Cookies have nothing to do with JWT, even with sessions.
@HelloThere-xs8ss11 ай бұрын
please read what a cookie is.
@smritisharan-sfdcamplified7 ай бұрын
excellent work and presentation. May i ask which TOOL HAS BEEN USED FOR ANIMATION?
@tinnick11 ай бұрын
As third party cookies are being deprecated in favor of FedCM, even with JWT we will not be able to implement SSO around mid 2024. JWT can still be used for logins without SSO though.
@rotatopotato52128 ай бұрын
Your voice is so calming. Thank you for another great lesson!
@jacobwwarner6 ай бұрын
Good short form video summary. Its more conceptual rather than technical, so i think the delivery method fulfilled the overall purpose.
@princezuko70736 ай бұрын
I am a newbie on this. Can you explain why it's conceptual than technical?
@jacobwwarner6 ай бұрын
@@princezuko7073 It didn't go into how you build a solution in code or using different libraries, frameworks, etc.
@princezuko70736 ай бұрын
@@jacobwwarner got it. Any good resources you’d recommend to practice in coding, using frameworks or libraries? NB: I am learning Django.
@punpompur11 ай бұрын
Couldn't agree more. Session management with JWT was a problem for me in a project because for one of the clients they wanted only one active session for a user.
@OverG8811 ай бұрын
Authorization services such as Keycloak can control that. Most likely through a number of issued refresh tokens.
@Kriishna478 ай бұрын
Is it not possible to look at the JWT payload and get the user details and maintain the session data to determine the concurrent sessions?
@jimdixxTubersSTV6 ай бұрын
@@Kriishna47 OIDC and JWT Token bring benefits of stateless application approach. Maintaining a session between a client and a server omits this benefit and the application becomes stateful by the principle. In this case, you may bring another authentication mechanism -> cookies, to track the user's session, typically. Also, you have to store the sessions on the server side. Good luck with easy horizontal scaling, as this adds another complexity to the whole architecture as you must store the session information in some key-value database for all the instances. Stateful applications also require a slightly different approach of security, such as CSRF protection and many more to avoid session theft, which does not differ from JWT token compromise attacks, which may be protected by refresh token rotation, etc, etc. In my opinion, if you can avoid it, do not use stateful approach, but some applications must be stateful (I know). However... mixing stateful and stateless approaches together are an anti-pattern in my opinion, adding unnecessary complexity to the system architecture.
@noyou1743 ай бұрын
@@Kriishna47 using session is better then in that situation
@nyantaro110 ай бұрын
Excellent video. What is the ideal way to authenticate and authorize these days?
@VietNamCombatZ2 ай бұрын
What program do you use to make your presentation ? They look so cool, I want to use them in my school project so much!
@pif502311 ай бұрын
I still fail to understand the security part of JWTs. If they are sent as unencrypted headers and can be easily stolen why should we rely on them for user authentication and by consequence for authorization?
@alastairzotos11 ай бұрын
They're not that easily stolen if you send them over HTTPS. The payload may not be encrypted, but an attacker can't modify the payload (i.e. replace your email or user ID with their own) because they would have to make a new signature for that payload, which requires them to have access to the signing key that only the server has
@Euquila11 ай бұрын
User supplies information to server to authenticate (like username/password or oauth token). Server mints new JWT and sends it back to client, who then stores it in browser storage/cookies. Client makes subsequent requests to server like POST /data to transmit data or GET /user to get their profile or even check if they are still authenticated using this JWT (since a status 401 on GET /user indicates your JWT is no longer good and client can re-route to sign-in page)
@ianokay11 ай бұрын
They're no more or less likely to be stolen than any alternative access token. The video itself is confusing
@vicaya11 ай бұрын
The video appears to be confused about different layers of security. JWT is just a serialization format to encode auth metadata. The actual security is guaranteed by the underlying protocols, like OIDC/OAuth2 etc, which mandate state and nonce fields, as well as https/TLS 1.2+ transport.
@vicaya11 ай бұрын
@@alastairzotos you also need additional mechanisms (state and nonce etc.) to avoid CSRF and replay attacks.
@jizhang240711 ай бұрын
Amazing animation.
@ianokay11 ай бұрын
It doesn't make any sense to suggest hijacking is a failure of JWT ("vulnerable to theft") since it's just an access token (with verifiably authentic user information). Access tokens could be hijacked as well, so it's no better or worse than the alternatives as a Bearer token. ☝🤔
@patenlikoyun11 ай бұрын
You can disable an access token if it's leaked
@patenlikoyun11 ай бұрын
I just realized after sending the message that jwts can be disabled also
@ianokay11 ай бұрын
@@patenlikoyun Yes because they aren't different except for what I noted
@alps74711 ай бұрын
@@patenlikoyunyou can't invalidate individual jwt tokens since they are not stored on the server. you can just delete the private key, so all tokens signed using that get invalidated which is a big impact as compared to invalidating individual sessions.
@M3t4lstorm11 ай бұрын
You can also put the client's IP (as seen by the server) in the JWT when creating it. Validate it just as you would the signature, issuer etc. Any attacker getting ahold of the JWT would have to perform the attack from the client's network, rather than sending it back to a Command and Control server/their network.
@saiki411611 ай бұрын
Really clear, concise explanantion.
@dashdoom84522 ай бұрын
Would like more details and nuance for a topic like this
@isophistchambers669410 ай бұрын
Thank you for this explanation
@raj_kundalia11 ай бұрын
Thank you!
@gus47311 ай бұрын
Really good, understandable explanation (plus your superior graphics)! Thanks! 😎✌️
@yogashvari42947 ай бұрын
Good explanation 👍👍👍
@apexcoder69755 ай бұрын
Nicely Explained
@Yorgarazgreece11 ай бұрын
i always pronounced them jay double u tees. first time i am hearing joughts lol
@saattlebrutaz11 ай бұрын
This is an absolutely amazing channel.
@math0111Ай бұрын
how did you made this animation?? waw>>>
@iammobenal4 ай бұрын
great presentation
@invisibleinvisible8311 ай бұрын
Thank you so much for this video🙏🏻
@luis96xd11 ай бұрын
Great video, everything was well explained, thanks!
@DatNickNganGonVaDeNho2 ай бұрын
standardlization is not good in jwt, jwt is lightweight but not light enough, especially it put in header request. we can still reduce header request : remove header jwt - service know how to verify itself using encode better than base64 or just encrypt it to store sensitive data, WHY NOT?
@CortezLabs3 күн бұрын
Love This
@rishiraj254811 ай бұрын
Thanks
@mad_t11 ай бұрын
I still prefer custom access tokens to jwt.
@rahulsalivendra6 ай бұрын
Hi, what are various ways we can encrypt and decrypt the payload using jwt?
@nonamespls34689 ай бұрын
the graphics look complex, and it disrupts the listener, too many unneeded visuals running around, this could have been explained in a more simple way
@unknowrabbit66611 ай бұрын
wow so much information /s
@stratboy29 ай бұрын
I thought it was a video about the james webb telescope..
@siddhantkumarkeshri699010 ай бұрын
informative
@danielmutuba962111 ай бұрын
A comment at minute 2:30, asymmetric encyption is where encyption uses public key, but decryption uses private key, but you say otherwise in the video. A great video nonetheless
@Reza1984_11 ай бұрын
I thought this first, but it's used for signing not encryption.
@arjundureja10 ай бұрын
You sign with the private key so that anyone with the public key can verify the signature
@TobiasSette10 ай бұрын
I missed an example showing how to not use JWT in sessions
@ToanTrancodeblog11 ай бұрын
Nice video
@Applecitylightkiwi11 ай бұрын
V good
@the_space_astronaut75348 ай бұрын
Ok
@stevenhe34627 ай бұрын
Was expecting James Webb Telescope.
3 ай бұрын
bad start of the video: 0:56 the json example is doubly malformed: 1) it uses smart quotes; 2) the keys 'exp' and 'sub' have an extra closing double quote
@BecherTammy-e4eАй бұрын
Cierra Plains
@DelbertRoberge-v7j2 ай бұрын
Kacey Plains
@MillEd-f5d2 ай бұрын
McLaughlin Ports
@DionDifilippo-u5cАй бұрын
Bailey Pass
@sirinath11 ай бұрын
What do you use for these animations?
@roauf-11 ай бұрын
Nobody knows, I asked and got no replies 😔
@TF24211 ай бұрын
If I was to guess After Effects
@akankshagupta368711 ай бұрын
I also have same question
@FarishKashefinejad11 ай бұрын
It is in the description, illustrator and after effects.
@CasimiroBukayo11 ай бұрын
Probably After Effects. But it can also be done using Manim
@rujor6 ай бұрын
I don't think the closed envelope analogy is accurate. As far as I know, anyone can *read* the payload, no?
@ElizabethBeall-q4wАй бұрын
Murphy Plains
@robpearce11 ай бұрын
0:58 - "Easy for humans to read and write".... you have a syntax error, lol.
@DemPilafian11 ай бұрын
I wouldn't have been able to read that file at all. If that error was easy for you to spot, you must be one of those humans.
@MargeryGodfery-x9pАй бұрын
Karli Plains
@CharlesAnderson-p7lАй бұрын
Witting Gardens
@SoyJavero4 ай бұрын
Does anybody know how to make does incredible diagrams with animations whatever? Please
@MariaHernandez-p8p2 ай бұрын
Parker Heights
@HelenGonzalez-w4kАй бұрын
Ryan Alley
@Smoonwalkerm11 ай бұрын
I don't like to enconde user data in JWT...specially if you have to send roles and permissions
@biomorphic11 ай бұрын
You should never send roles and permissions, that would be a huge security breach. You check roles and permissions based on the ID.
@Gringohuevon11 ай бұрын
@@biomorphic Based on the claims?
@Smoonwalkerm11 ай бұрын
@@biomorphic anyways... I always have doubts on this matter... Because consulting an endpoint that returns your roles and permissions in a normal http request seems very insecure to me
@M3t4lstorm11 ай бұрын
There isn't any security issues putting roles and permissions in a JWT.
@aakarshan464411 ай бұрын
@@biomorphic or maybe the authZ policies can be handled at the gateway. btw apart from the roles being public, I don't see any other issue especially if you want the request to be authZ stateless. Preferably I think the best way is to incorporate zanzibar adjacent open source tools to deal with user/service policy at an atomic level.
@MariaDean-d1lАй бұрын
Garrett Pass
@GoldViolet-z5rАй бұрын
Abel Road
@EuphemiaZebulon-d7g2 ай бұрын
Jacobs Branch
@BaconSebastiane-s8xАй бұрын
Abshire Street
@StanleyNelson-f8i2 ай бұрын
Alexander Avenue
@ElizabethJacobs-w7xАй бұрын
Hudson Harbor
@siddhantkumarkeshri699010 ай бұрын
thanks for explanation
@GrahamDean-h8e2 ай бұрын
Paul Street
@WilmaLambdin-d2sАй бұрын
Donnelly Spurs
@withanujmittal28005 ай бұрын
best
@vladimir0rus9 ай бұрын
Actually JSON is not simple to machines to parse and generate. Any binary format much easier for machines.
@SpringhallAmelia-n3h2 ай бұрын
Runolfsdottir Terrace
@LandonAlbert-j4q2 ай бұрын
Dibbert Locks
@ChurchKelly-e1hАй бұрын
Kreiger Mill
@Misteribel9 ай бұрын
1:03, that's illegal json. You can only use straight quotes, not stylized quote characters (fun fact: just about every tech video makes this mistake, you'd expect tech nerds to know how to fix quotes, right). Rant aside, very clear explanation, thanks!
@MegMorgan-o3eАй бұрын
Kutch Stravenue
@BabbittMonroe2 ай бұрын
2817 Mayert Island
@ThackerayAudrey-j5g2 ай бұрын
Lee Jose Jackson Christopher Davis Larry
@GillAries-s8bАй бұрын
O'Kon Radial
@shirleybargeman4484Ай бұрын
Harris Jose Thompson Shirley Brown Paul
@SoniyaKhan-g2y2 ай бұрын
Martin Scott Moore Nancy Lewis Edward
@ElmaNisa-t1n2 ай бұрын
Gutkowski Inlet
@fumanchu3329 ай бұрын
JSON lightweight? That's rich... 🤣🤣🤣
@SamiraMahi-l2kАй бұрын
Smith Robert Hernandez Deborah Harris Donald
@KimberlyTaylor-b8d2 ай бұрын
Legros Mountains
@biomorphic11 ай бұрын
You do assume that the token is generated server side, which is not always the case. If your client is a mobile app, then it is much better if you generate the token on the client. The mobile app generates a new token for every new call, signing the token with the private key. The token would then be verified with the public key. The pair (private/public key) is generated during the sign up/sign in process. The public key is stored on the server, the private key in stored on the device keychain. No replay attack is possible in this configuration. Implemented for two different apps, first time 6 years ago. Most people creates a server side token, which is not as secure, because you can steal the token. And generally this token expires after days, otherwise you would have to issue a new token, and maybe ask to relogin every day, which is really annoying.
@doxologist11 ай бұрын
Although its possible to do it like this, I've never seen anyone generate JWTs on the client side. This entire flow sounds extremely inefficient and counter-productive. You may as well use cookies+session management if you were to implement it like this...
@marklnz11 ай бұрын
@@doxologistAgreed - general rule is to never trust the client, and that would extend to JWT. @Biomorphic, consider that if your private key is in the mobile app, then you basically just *gave it to an attacker to use themselves*. Generating client side is a crappy idea.
@biomorphic11 ай бұрын
It is not inefficient. Generating a token is not really time consuming. And it is much more secure, and never requires to relogin or to use a session, which are indeed slow and dangerous.@@doxologist
@biomorphic11 ай бұрын
You are wrong. How do you steal a secret that is stored in the keychain? You need to have access to the device, and you need to know the device password to access the keychain, and even if you have access, the value stored in the keychain can be encrypted. At that point you would need to debug the app itself to see which key is used to decrypt. Considering apps are sandboxed, you are not going to do that, not in a million years. And if you manage, that means you have full control of the device. You can't do shit if you don't have access to the device. But you can steal a token generated on the server any time. Also the token generated by the client can't be reused, because it changes for every call, so you cannot even perform a replay attack. And you don't need any fuckin session. To be able to act like that client you need to be able to generate a token with uid, did, exp, nbf, and sign it with the private key, which means you need to have access to it. You can steal the token as many times you want but you cannot ever use it. Meanwhile if you steal a token generated by the server, you can use it multiple times, and even alter it. And by the way, generating a token on the client is what Apple does. You all go for the easiest, or better, the most used solution, which is often the worst. Sessions should never be used. @@marklnz
@marklnz11 ай бұрын
@@biomorphic 1) not all apps are on Apple. 2) Not all clients are apps. 3) You are naive in the EXTREME if you think for one second that ANY secret on ANY client is completely safe. I'm not going to go into the specifics of anything but attacks on the keychain HAVE been successful in the past. If you build an app and say "I'm generating the token here so I need the private key" then you're making that a requirement for ALL clients of the service you're securing. So a website that uses the same API, for example. That website is going to then ALSO have to have a copy of the private key. Do you see where I'm going with this yet? You're also assuming that all users of the app are *legitimate* users. "You need to have access to the device, and you need to know the device password to access the keychain" - if I'm trying to access your API by generating a fake token then I'm just gonna go ahead and install your app on my device - then guess what? I *have* the device and I *know* the password. FFS man! Get it through your head - NEVER store secrets on a CLIENT!!!! Also, your assumption that I use sessions is wrong. I've NEVER done it that way. Always use JWT, just with *server signing* as you're SUPPOSED TO DO.
@MariaThompson-d7yАй бұрын
Garcia Mary Brown Jose Moore David
@vivekpaliwal18768 ай бұрын
Nobody is explaining how to manage session across login, logout and others requests. Across all apps.
@KellyMason-f6eАй бұрын
Klocko Center
@DelmaHalm-l4gАй бұрын
Lela Place
@EricScheid9 ай бұрын
"jots" ?? Surely, they should be pronounced as "juuts"
@AntoinetteSusie-r3m2 ай бұрын
Rodriguez Barbara Wilson Matthew Young Betty
@leticiadavis-pq6lm2 ай бұрын
White Brian Taylor Richard Young Jose
@WallaceAubrey-b2mАй бұрын
Young Kenneth Gonzalez Sarah Smith Angela
@DaisyHayes-n2k2 ай бұрын
Moore Angela Jackson Helen Hall Eric
@PiersGabriel-f2vАй бұрын
Hand Rue
@DianaMarconi-h7dАй бұрын
Armstrong Course
@jay_wright_thats_right7 ай бұрын
This info is too basic. I think you draw in people because they get excited over animations. LOL! Well done. 🤣🤣🤣🤣