Token vs Session Authentication | Authentication Explained!!!

  Рет қаралды 54,899

Piyush Garg

Piyush Garg

Күн бұрын

Пікірлер: 89
@himankshu
@himankshu 9 ай бұрын
I love your teaching style. One thing if you add to make it cherry on the top is show real life examples
@vishalpable9636
@vishalpable9636 10 ай бұрын
Great explanation Piyush, I am thrilled to see this video because you explained it more clearly and easily understandable 👏
@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.
@parikshitjagtap7633
@parikshitjagtap7633 6 ай бұрын
Awesome explanation.. One of the best video I ever seen for token and sessions..
@suchanachakrabarti6783
@suchanachakrabarti6783 9 ай бұрын
The Easiest explanation of all times!
@yatendraupadhyay2180
@yatendraupadhyay2180 8 ай бұрын
Bhai you deserve many more subscribers. Such a simple yet comprehensive explanation.
@KirtanPatel552
@KirtanPatel552 11 ай бұрын
Mind Blowing Video Piyush sir....
@ersouravkmr
@ersouravkmr 3 ай бұрын
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 .
@ashishsng
@ashishsng 6 ай бұрын
I am saying this very honestly.. what a explanation!🔥🔥
@2brothers346
@2brothers346 2 жыл бұрын
Keep continuing this hard work bro🔥🔥
@piyushgargdev
@piyushgargdev 2 жыл бұрын
Thanks a lot 🎉
@devlo57
@devlo57 Жыл бұрын
But token can only be generated when credentials are correct and it can only be leaked from user itself 🤔
@roshanshah7364
@roshanshah7364 9 ай бұрын
I think for improving security we can save the jwt token in cookies instead of local storage.
@muditkhanna8164
@muditkhanna8164 10 ай бұрын
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 2 ай бұрын
Its usually stored in config or environment variable, not database
@utsavkumar4826
@utsavkumar4826 9 ай бұрын
serverless can be durable as well, such as azure durable functions
@haristallat2201
@haristallat2201 5 ай бұрын
Perfectly explained, love from Pakistan
@dharamved
@dharamved 8 ай бұрын
very helpful video and love your way of making any question easy to understand.
@raushankumargupta7018
@raushankumargupta7018 7 ай бұрын
Perfect explaination Piyush❤
@harshshah2675
@harshshah2675 Жыл бұрын
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
@ombhandari6148
@ombhandari6148 Жыл бұрын
Finally understood it. Thanks to you brother ✨❤
@piyushgargdev
@piyushgargdev Жыл бұрын
Most welcome 😊
@rahulsbytes
@rahulsbytes 10 ай бұрын
@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 10 ай бұрын
yeah but that will increase database calls and slower the performance of the application
@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 10 ай бұрын
Same opinion
@imvivekkushwaha
@imvivekkushwaha Жыл бұрын
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
@ErLakhan
@ErLakhan 10 ай бұрын
Great, Have a question, How do we invalidate JWT in serverless environment..
@Ganeshthokala97
@Ganeshthokala97 9 ай бұрын
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 😅
@radhikakhatri6851
@radhikakhatri6851 3 ай бұрын
Amazing Explanation!!
@nitinkumarpachori688
@nitinkumarpachori688 Жыл бұрын
well explanation Piyush 🤝
@XoXoHarsh
@XoXoHarsh 5 ай бұрын
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.
@parassetia4964
@parassetia4964 8 ай бұрын
Great content and way of explanation
@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
@faizshaikh4256
@faizshaikh4256 5 ай бұрын
great explanation sir!!
@riturajprajapati5660
@riturajprajapati5660 6 ай бұрын
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
@AbhishekKumar-wx3rw
@AbhishekKumar-wx3rw 2 ай бұрын
thanks a lot bro was a great video
@ritikadhangar2979
@ritikadhangar2979 Жыл бұрын
Best Explanation😇
@user-ox1wu7iz1l
@user-ox1wu7iz1l 6 ай бұрын
Best on Authentication
@bhavyasrivastava9656
@bhavyasrivastava9656 6 ай бұрын
Hey hi JWT aren't that secure but then what about security?? Please tell me how to make the JWT token secure???
@crackit5254
@crackit5254 Жыл бұрын
Gajab bhai 🙌
@jaydattr9765
@jaydattr9765 Жыл бұрын
you explained really well
@maverickansh
@maverickansh 9 ай бұрын
wow ! clearity ++
@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
@shubhamsharma-js7xf
@shubhamsharma-js7xf 25 күн бұрын
Please make video where you can tell how we can manage token. Like this is right user or not If hacker stole out token how we can prevent then not to access my details etc. Thanks in advance ❤❤
@kirtikedia6274
@kirtikedia6274 5 күн бұрын
Cant hacker steal session id as well in the same way they are stealing Tokens?
@AsmaKhan-qf6gd
@AsmaKhan-qf6gd Жыл бұрын
in case of session authentication session_id is automatically generated when we start session and store in cookies?
@agentgamer1150
@agentgamer1150 Ай бұрын
To jo jwt token copy krha h usko to phir credentials maloom hi honge jo copy krha h
@KaushalWaghela
@KaushalWaghela 6 ай бұрын
bhai agar without user login api par authentication lagana ho to kese kar sakte?
@anupamchaudhary1015
@anupamchaudhary1015 5 ай бұрын
great explaination bro
@SHIVAMOJHA21
@SHIVAMOJHA21 2 ай бұрын
how can we encrypt jwt?
@webverse8564
@webverse8564 7 ай бұрын
how do you overcome security issues with JWT token make a video on that
@vinayjangra1401
@vinayjangra1401 11 ай бұрын
Thanks a lot 😀😀👍👍🙏🙏
@ayushjindal4981
@ayushjindal4981 Жыл бұрын
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 10 ай бұрын
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.
@iamyuvraj128
@iamyuvraj128 Жыл бұрын
Well explained 🔥
@laxmangiri5511
@laxmangiri5511 Жыл бұрын
bro where we store signature in server. So how can it be serverless since we are storing signature in server?
@muditkhanna8164
@muditkhanna8164 10 ай бұрын
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.
@razahaider6173
@razahaider6173 2 жыл бұрын
Great explanation.
@piyushgargdev
@piyushgargdev 2 жыл бұрын
Glad you liked it
@fightforfitness2256
@fightforfitness2256 6 ай бұрын
Thank you bhaiya.
@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
@disha_on_air
@disha_on_air 7 ай бұрын
Great, higly recommend
@Abhay-d8j
@Abhay-d8j 6 ай бұрын
good video 👍
@mma-dost
@mma-dost 2 жыл бұрын
Please make a practical tutorial authentication with jwt something like this please bhaiya ?
@piyushgargdev
@piyushgargdev 2 жыл бұрын
Okay sure
@harshsijariya6005
@harshsijariya6005 Жыл бұрын
good explanation
@akash_gupta_2090
@akash_gupta_2090 Ай бұрын
great video
@Onemanfive
@Onemanfive 5 ай бұрын
make video on ola api setup in next js
@ri-deep
@ri-deep 2 жыл бұрын
Awesome sir
@suryanshverma2311
@suryanshverma2311 8 ай бұрын
Sir please serverless ka detailed course launch karo
@Aditya_Kumar_Alok
@Aditya_Kumar_Alok 7 ай бұрын
Nice Explain
@princeyadav8034
@princeyadav8034 2 жыл бұрын
How to store token in browser
@piyushgargdev
@piyushgargdev 2 жыл бұрын
Local Storage
@MuzzaferAli
@MuzzaferAli 2 жыл бұрын
store in cookies. localStorage and sessionStorage do not provide enough security for storing auth tokens
@biggestgamelibrary4025
@biggestgamelibrary4025 5 ай бұрын
@@MuzzaferAli what if it's encrypted before being stored in local or session storage ?
@payalkatoch4377
@payalkatoch4377 11 ай бұрын
nice voice
@Alim-290
@Alim-290 Жыл бұрын
session bhi to chori ho skta h ?
@yashvant6482
@yashvant6482 5 ай бұрын
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 😶😃
@MuzzaferAli
@MuzzaferAli 2 жыл бұрын
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 2 жыл бұрын
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 😅.
@gaurav-yadav
@gaurav-yadav 11 ай бұрын
Memory = RAM
@rishiraj2548
@rishiraj2548 3 ай бұрын
Demigod
@sakshishrivastav1670
@sakshishrivastav1670 Жыл бұрын
i love u
@ajazulhaq3176
@ajazulhaq3176 Жыл бұрын
This was beyound infinity 😂
What is JWT token and JWT vs Sessions
26:12
Chai aur Code
Рет қаралды 103 М.
Session Vs JWT: The Differences You May Not Know!
7:00
ByteByteGo
Рет қаралды 305 М.
When you have a very capricious child 😂😘👍
00:16
Like Asiya
Рет қаралды 18 МЛН
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 61 МЛН
How SSL Certificate Works?  - HTTPS Explained
20:42
Piyush Garg
Рет қаралды 298 М.
Web Authentication Methods Explained
10:01
Software Developer Diaries
Рет қаралды 29 М.
#35 What is JWT and Why
14:47
Telusko
Рет қаралды 34 М.
Access token and refresh token in Backend
30:08
Chai aur Code
Рет қаралды 93 М.
Difference between cookies, session and tokens
11:53
Valentin Despa
Рет қаралды 669 М.
Proxy vs Reverse Proxy vs Load Balancer | Simply Explained
13:19
TechWorld with Nana
Рет қаралды 248 М.
What is Serverless? | Serverless Vs Monolith | AWS Lambda
36:11
Piyush Garg
Рет қаралды 140 М.
Why is JWT popular?
5:14
ByteByteGo
Рет қаралды 346 М.