Token vs Session Authentication | Authentication Explained!!!

  Рет қаралды 51,566

Piyush Garg

Piyush Garg

Күн бұрын

Пікірлер: 87
@himankshu
@himankshu 8 ай бұрын
I love your teaching style. One thing if you add to make it cherry on the top is show real life examples
@the-white-fang
@the-white-fang Жыл бұрын
Interesting video. I do have a couple of questions though. The arguement of being token stolen seems like an unfair one since that could happen to cookies as well. Though there are some scenarios where sessions aren't just a valid answer for example mobile apps. Usually in mobile apps you can't really rely on sessions being persisted and can't expect the users to login in over and over again. On the other hand session based authentication works really well for the web apps. Ofcourse if you work in development professionally, you will need to implement both a lot of times with consistent behaviour. This is a good introduction for beginners though but it would be great if it was mentioned that there were more advanced forms of authentication methods and links to the documentation would have been a massive plus.
@vishalpable9636
@vishalpable9636 9 ай бұрын
Great explanation Piyush, I am thrilled to see this video because you explained it more clearly and easily understandable 👏
@suchanachakrabarti6783
@suchanachakrabarti6783 7 ай бұрын
The Easiest explanation of all times!
@ersouravkmr
@ersouravkmr 2 ай бұрын
Lovely Lecture ❤❤ , Cleared All my doubts about Authetication Process , Token Vs Session Based , Stateless vs State fulll. Saw your another lecture on SSO. Cleared all doubts on that Topic also .
@parikshitjagtap7633
@parikshitjagtap7633 5 ай бұрын
Awesome explanation.. One of the best video I ever seen for token and sessions..
@ashishsng
@ashishsng 5 ай бұрын
I am saying this very honestly.. what a explanation!🔥🔥
@yatendraupadhyay2180
@yatendraupadhyay2180 7 ай бұрын
Bhai you deserve many more subscribers. Such a simple yet comprehensive explanation.
@roshanshah7364
@roshanshah7364 8 ай бұрын
I think for improving security we can save the jwt token in cookies instead of local storage.
@KirtanPatel552
@KirtanPatel552 9 ай бұрын
Mind Blowing Video Piyush sir....
@devlo57
@devlo57 11 ай бұрын
But token can only be generated when credentials are correct and it can only be leaked from user itself 🤔
@utsavkumar4826
@utsavkumar4826 8 ай бұрын
serverless can be durable as well, such as azure durable functions
@haristallat2201
@haristallat2201 4 ай бұрын
Perfectly explained, love from Pakistan
@2brothers346
@2brothers346 2 жыл бұрын
Keep continuing this hard work bro🔥🔥
@piyushgargdev
@piyushgargdev 2 жыл бұрын
Thanks a lot 🎉
@harshshah2675
@harshshah2675 11 ай бұрын
Piyush sir thanks for this detailed explanation. It would be great if you could explain how to overcome drawback of jwt what's the solution for it
@dharamved
@dharamved 6 ай бұрын
very helpful video and love your way of making any question easy to understand.
@raushankumargupta7018
@raushankumargupta7018 6 ай бұрын
Perfect explaination Piyush❤
@radhikakhatri6851
@radhikakhatri6851 2 ай бұрын
Amazing Explanation!!
@user-ox1wu7iz1l
@user-ox1wu7iz1l 4 ай бұрын
Best on Authentication
@faizshaikh4256
@faizshaikh4256 4 ай бұрын
great explanation sir!!
@parassetia4964
@parassetia4964 7 ай бұрын
Great content and way of explanation
@ombhandari6148
@ombhandari6148 Жыл бұрын
Finally understood it. Thanks to you brother ✨❤
@piyushgargdev
@piyushgargdev Жыл бұрын
Most welcome 😊
@AbhishekKumar-wx3rw
@AbhishekKumar-wx3rw Ай бұрын
thanks a lot bro was a great video
@maverickansh
@maverickansh 7 ай бұрын
wow ! clearity ++
@nitinkumarpachori688
@nitinkumarpachori688 Жыл бұрын
well explanation Piyush 🤝
@muditkhanna8164
@muditkhanna8164 9 ай бұрын
Very Effective explanation. but does server stores the secret key string in its database and the respective hash function, that means its still using memory for decoding the specific user from the token? i don't understand how can it be a advantage.
@AniketSingh-nx4ds
@AniketSingh-nx4ds 27 күн бұрын
Its usually stored in config or environment variable, not database
@anupamchaudhary1015
@anupamchaudhary1015 4 ай бұрын
great explaination bro
@ritikadhangar2979
@ritikadhangar2979 Жыл бұрын
Best Explanation😇
@jaydattr9765
@jaydattr9765 Жыл бұрын
you explained really well
@fightforfitness2256
@fightforfitness2256 5 ай бұрын
Thank you bhaiya.
@ErLakhan
@ErLakhan 8 ай бұрын
Great, Have a question, How do we invalidate JWT in serverless environment..
@Ganeshthokala97
@Ganeshthokala97 8 ай бұрын
We can set expiry for access token and refresh token. But we can't invalidate directly unless we store that JWT in our DB. But if we need to invalidate all we can change the signature and hash key 😅
@crackit5254
@crackit5254 Жыл бұрын
Gajab bhai 🙌
@farhanali4623
@farhanali4623 Жыл бұрын
i think we can store session in DB itself with its life, to avoid re run of server issue
@lokehirl
@lokehirl Жыл бұрын
bro, db me query krna is time consuming as well as costly
@vinayjangra1401
@vinayjangra1401 10 ай бұрын
Thanks a lot 😀😀👍👍🙏🙏
@rahulsbytes
@rahulsbytes 9 ай бұрын
@07:35 The session will only destroy only when the session data in server memory if you store session data into database then after restating the session data will not destroy
@LeoWasHere1
@LeoWasHere1 9 ай бұрын
yeah but that will increase database calls and slower the performance of the application
@disha_on_air
@disha_on_air 6 ай бұрын
Great, higly recommend
@akash_gupta_2090
@akash_gupta_2090 23 күн бұрын
great video
@harshsijariya6005
@harshsijariya6005 Жыл бұрын
good explanation
@mm333-e1t
@mm333-e1t 2 жыл бұрын
Can u pls make a video explaining how are sessions and jwts are practically implemented and wat is done to handle their flaws.
@piyushgargdev
@piyushgargdev 2 жыл бұрын
Sure
@iamyuvraj128
@iamyuvraj128 Жыл бұрын
Well explained 🔥
@Aditya_Kumar_Alok
@Aditya_Kumar_Alok 6 ай бұрын
Nice Explain
@XoXoHarsh
@XoXoHarsh 3 ай бұрын
If JWT token can be taken by hacker and whats stopping hacker to get session id? how is session more secure i couldn't understand.
@Abhay-d8j
@Abhay-d8j 5 ай бұрын
good video 👍
@webverse8564
@webverse8564 6 ай бұрын
how do you overcome security issues with JWT token make a video on that
@sahildhanawade
@sahildhanawade Жыл бұрын
session cookie bhi to chori ho sakti hai like jwt token am i right its user's responsibility to keep it safe please correct me if I am wrong
@thoropyt9955
@thoropyt9955 9 ай бұрын
Same opinion
@razahaider6173
@razahaider6173 Жыл бұрын
Great explanation.
@piyushgargdev
@piyushgargdev Жыл бұрын
Glad you liked it
@ri-deep
@ri-deep 2 жыл бұрын
Awesome sir
@imvivekkushwaha
@imvivekkushwaha 10 ай бұрын
Hi I want to call the API on the server in next.js but token is in localstorage. How I do this. It is causing me to call all API on client side
@agentgamer1150
@agentgamer1150 19 күн бұрын
To jo jwt token copy krha h usko to phir credentials maloom hi honge jo copy krha h
@bhavyasrivastava9656
@bhavyasrivastava9656 5 ай бұрын
Hey hi JWT aren't that secure but then what about security?? Please tell me how to make the JWT token secure???
@Onemanfive
@Onemanfive 4 ай бұрын
make video on ola api setup in next js
@riturajprajapati5660
@riturajprajapati5660 5 ай бұрын
If someone copied the jwt token or theft token and after logout trying to access any page of information then how can we handle it
@mma-dost
@mma-dost Жыл бұрын
Please make a practical tutorial authentication with jwt something like this please bhaiya ?
@piyushgargdev
@piyushgargdev Жыл бұрын
Okay sure
@SHIVAMOJHA21
@SHIVAMOJHA21 Ай бұрын
how can we encrypt jwt?
@suryanshverma2311
@suryanshverma2311 7 ай бұрын
Sir please serverless ka detailed course launch karo
@KaushalWaghela
@KaushalWaghela 5 ай бұрын
bhai agar without user login api par authentication lagana ho to kese kar sakte?
@payalkatoch4377
@payalkatoch4377 10 ай бұрын
nice voice
@ayushjindal4981
@ayushjindal4981 10 ай бұрын
Does every user have a separate signing key in case of JWT? if yes, then it would require memory to store it..right? Also, if we are storing the token-id with the user id, there also memory is being used..
@coderx7177
@coderx7177 9 ай бұрын
The server don't remember the jwt as it was doing in case of session, in case of session it was keeping the track of the uniquely assigned session id to the user details, whereas in case of jwt it don't really keep the track which jwt is assigned to which user instead it just signs it and now it's user's/client's headache to keep it secure, and send it with every request that needs to be authenticated. Since there is no such persisting map in server regarding which user is associated with which jwt, jwt it is called stateless.
@AsmaKhan-qf6gd
@AsmaKhan-qf6gd Жыл бұрын
in case of session authentication session_id is automatically generated when we start session and store in cookies?
@pk21734
@pk21734 Жыл бұрын
Bhai, ek doubt hai, jo sessions mein user information store ho rahi hai in memory, jwt ke case mein bhi kahin store hoti hai na, even if it's in the API provider, so how is memory a problem in sessions but not in jwt?
@Harsh-rm1tp
@Harsh-rm1tp Жыл бұрын
Jwt m koi data store nai Krna hota. Bas ek secret key hoti hai jo env variables m add hoti hai.
@pk21734
@pk21734 Жыл бұрын
@@Harsh-rm1tp okayy
@laxmangiri5511
@laxmangiri5511 Жыл бұрын
bro where we store signature in server. So how can it be serverless since we are storing signature in server?
@muditkhanna8164
@muditkhanna8164 9 ай бұрын
the server uses an external db for mapping signature with the user. and meanwhile in sessions the session id is not stored in an external and on refreshing ,we get logged out.
@MuzzaferAli
@MuzzaferAli Жыл бұрын
Hey, session id is stored in browser cookies and it can also be stolen. Btw token authentication is more secure than session authentication!!
@piyushgargdev
@piyushgargdev Жыл бұрын
Yes, you are correct. In this video I just gave a comparison about the two ways. I hope I didn’t made any wrong statement in video 😅.
@princeyadav8034
@princeyadav8034 2 жыл бұрын
How to store token in browser
@piyushgargdev
@piyushgargdev 2 жыл бұрын
Local Storage
@MuzzaferAli
@MuzzaferAli Жыл бұрын
store in cookies. localStorage and sessionStorage do not provide enough security for storing auth tokens
@biggestgamelibrary4025
@biggestgamelibrary4025 4 ай бұрын
@@MuzzaferAli what if it's encrypted before being stored in local or session storage ?
@Alim-290
@Alim-290 11 ай бұрын
session bhi to chori ho skta h ?
@yashvant6482
@yashvant6482 3 ай бұрын
Yes, if hacker connected in same network and capture the user's cookies or session and use that same session to login without userid and password 😶😃
@gaurav-yadav
@gaurav-yadav 10 ай бұрын
Memory = RAM
@sakshishrivastav1670
@sakshishrivastav1670 11 ай бұрын
i love u
@ajazulhaq3176
@ajazulhaq3176 10 ай бұрын
This was beyound infinity 😂
@rishiraj2548
@rishiraj2548 2 ай бұрын
Demigod
Difference between cookies, session and tokens
11:53
Valentin Despa
Рет қаралды 656 М.
Миллионер | 3 - серия
36:09
Million Show
Рет қаралды 2,1 МЛН
Session Vs JWT: The Differences You May Not Know!
7:00
ByteByteGo
Рет қаралды 261 М.
oAuth for Beginners - How oauth authentication🔒 works ?
10:43
What Is JWT and Why Should You Use JWT
14:53
Web Dev Simplified
Рет қаралды 1,2 МЛН
What is JWT token and JWT vs Sessions
26:12
Chai aur Code
Рет қаралды 91 М.
How SSL Certificate Works?  - HTTPS Explained
20:42
Piyush Garg
Рет қаралды 282 М.
OAuth 2.0 explained with examples
10:03
ByteMonk
Рет қаралды 160 М.
What are Cookies in NodeJS?
30:35
Piyush Garg
Рет қаралды 73 М.
What is WebSocket? Why is it used & how is it different from HTTP?
15:32