one of the best code tutorials I've ever watched. Clear, concise and simple. Fantastic video 👏
@KrisFoster1
3 жыл бұрын
Thank you for the kind words!
@tonienguix4834
3 жыл бұрын
@@KrisFoster1 hey Kris! sorry I sent you a question on twitter. How can I send the user object to the client? thank you!
@orenzbeda6072
2 жыл бұрын
try this one: kzitem.info/news/bejne/lo2bzo6Kq5l4a6Q
@uk4876
2 жыл бұрын
Yeah I agree
@anfaenfpanthqwefbdas
Жыл бұрын
Absolutely, straight to the point and no waste of time
@jeanlucas9702
2 жыл бұрын
Dude this is the best video I've ever seen about Google OAuth with passport you have no idea how many videos I watched to use Google OAuth with passport a big thank you from Brazil
@codingrussell138
3 жыл бұрын
Had to comment. Went from never working with passport or Oauth to implementing 5 different types of login on my test app. Amazing tutorial.
@KrisFoster1
3 жыл бұрын
That's great to hear @Dev Dev Goose. Well done!
@immensives147
5 ай бұрын
Damn 🙄
@ilanle
Жыл бұрын
I have seen a lot and I am impressed by how you manage to get a confusing subject through and so consicely and simple to understand
@crazedbrazy617bh
3 жыл бұрын
Great video, have been struggling with this for the past few days, your the first one to tie in all the pieces, authentication, user session, and log out. Thank you good sir!
@LeighBriody
Жыл бұрын
Such a lack of videos explaining this topic , thank you man !
@arnabbanik6403
2 жыл бұрын
Really amazing tutorial, actually the only one where I understood what each part of the code was doing.
@GlitchedFailure
8 ай бұрын
To the point, goes step by step. Well done!
@itsnobledean9450
9 ай бұрын
This video was full of value. I was able to complete it, but even better, I was able to complete it, and now I feel comfortable with utilizing passport/google-oauth2 in my projects moving forward.
@immensives147
5 ай бұрын
Other than him, no one was helpful to me for this particular problem, Thanks Man 👍
@abdulsamihamedi5584
9 ай бұрын
it helped me bro, always keep your tutorials as clear as this!!!
@codinginflow
2 жыл бұрын
Thank you, this helped me a lot
@firojsiddiki2750
3 жыл бұрын
Simplest Code and Simplest explanation. awesome
@haoyuandong
3 жыл бұрын
Thanks for this simple but clear video.
@KrisFoster1
3 жыл бұрын
Glad you enjoyed!
@Bl4sTTer
2 жыл бұрын
Most helpful video I found about OAuth2 with Node. Thank you
@paritoshpanigrahi007
3 ай бұрын
I used your code, but did not get refresh token, I tried option access_type: 'offline', but still it is not giving refresh token. Could you please tell me how can I get the refresh token. It would be helpfull if you could make a video on it. The solution is not present on internet.
@dremmaokoh5011
Жыл бұрын
Great video. Short and precise . Thanks alot
@edisonmondal2798
Ай бұрын
You are one of the best Tutor.
@cookie2glue
Жыл бұрын
10:21 The silence here killed me lol
@andrews13
6 ай бұрын
So, will the Node.js application use the email address as some Primary Key in the database to identify a user?
@DEV_XO
3 жыл бұрын
Yo mate, great video. Do you know if there is a way to get rid off the "#" at the end of the route? I mean, redirecting without the slash sign at the end. Ty!
@vidyashet800
8 ай бұрын
Was so confused with Google Auth, Thank you so much for this wonderful tut
@taufiksatya9695
Жыл бұрын
You're the best explain for this mate.
@TOMGAMING-hy9hi
2 жыл бұрын
a very big big thanks to you sir for giving such an amazing explanation.............!!!!!!!!!!
@orenzbeda6072
2 жыл бұрын
Maybe you will like this also so much simpler: kzitem.info/news/bejne/lo2bzo6Kq5l4a6Q
@indraargamuria4774
3 жыл бұрын
This is such a great tutorial Mr Kris I can retrieve the email displayName with no problem, but how do I know the other Function? Like Retrieve the photo profile or other information? I hope you see my question here, Cheers to you!
@generalknow_ledge
11 ай бұрын
Your explanation is awesome dude thankyou very much for the knowledge ❤
@blacktipe9922
3 жыл бұрын
can we somehow edit this page with some better style? Like an Logout button on the top right corner and some general design instead of the white page?
@info662
2 жыл бұрын
Subscribed! Hey, what if I wanted to return a token instead of a session id?
@kirillpavlovskii8342
2 жыл бұрын
You used your personal client google id, but how to get it from the user when he hit use button authenticate with Google on my website ?
@orenzbeda6072
2 жыл бұрын
This is simpler: kzitem.info/news/bejne/lo2bzo6Kq5l4a6Q
@nerozonbolt
Ай бұрын
Any tips on how to do this using the architecture Route/Controller/Service
@yabuking84
3 жыл бұрын
Question: why do you need to serialize or deserialize user data? stated at 8:47? Thanks
@samart3010
2 жыл бұрын
I haven't watched this vid yet but serialize means you are making cookie and deserialize means extracting data from that session cookie. The result of the serializeUser method is attached to the session as req.session.passport.user = {}.
@IonizedComa
7 ай бұрын
I know this is 2 years old but just leaving it for someone here who is also curious, the serialization defines how you want to attach the user data to the session, for instance if you wanted to filter the user data to like 3 attributes in you would define 'done' inside the serialization method as: ``` passport.serializeUser((user, done) => { done(null, { id: user.id, email: user.email, cover: user.cover }); }); ``` this reduces the size of your session data by excluding unecessary fields in the video for the sake of simplicity the guy just attached the entire payload your deserializeUser function would just assign the data in req.session.passport.user to req.user to make it easier for use
@omarruder4129
10 ай бұрын
Do you know how I can use this same session in my google extension, so that it automatically logs in the user to my extension?
@willysnowman
2 жыл бұрын
Below seems to work for logout needing a funcion issue in latest version of express. app.get('/logout', (req, res, next) => { req.logout(function (err) { if (err) { return next(err); } // if you're using express-flash // res.flash('success_msg', 'session terminated'); res.redirect('/'); }); });
@avalancherelapse
2 жыл бұрын
very important comment here, thank you! kris foster should pin this!!!
@marcofari532
7 ай бұрын
Yes req.logout() needs a callback
@dwijvirani7919
2 жыл бұрын
Thanks bro for the detailed explanation. It was a great help
@W_Wadu
Жыл бұрын
15:08 What do you mean when you said we need to allow the user to be sent as part of the request? I don't really get it.
@W_Wadu
Жыл бұрын
And how does express-session solve this?
@artax5005
Жыл бұрын
Express-session allows to create a session (req.session object) and can store the session into a database. To store a session where an user is authenticated, Passport comes into play, it's Passport with the serializeUser function that saves inside the session created by Express-session, a property => passport: {user: id} and then Express-session can store the session + the authenticated user inside a db and the server send an http response with the header set-cookie and now the browser saves the cookie and the user is authenticated. If you want to undersand how it works in details, watch the local authentication with Passport here (the first 3 hours) kzitem.info/news/bejne/p2OprKSVeqh5lm0.
@W_Wadu
Жыл бұрын
@@artax5005 Wow this helps, thank you so much
@harpuneetkalsi5960
Жыл бұрын
is cookie saved in browser in case of token based authentication, i can't find cookie in my browser although when i am am using cookie based authentication , then only i can see cookie saved in my browser??
@ayhamahmad6184
2 жыл бұрын
Thank you so clear explaining
@juanisidorogarcia1699
2 жыл бұрын
great job! Thank you very much for the content ^^ A query, what is the difference between oauth2 and oauth20? - Passport-google-oauth20 - Passport strategy for Google OAuth 2.0 Thank you so much for everything!
@LucianoClassicalGuitar
Жыл бұрын
It's the same. It's 2.0 but abbreviated to 20
@atv8992
3 жыл бұрын
InternalOAuthError: Failed to obtain access token why am i getting this?
@kelwong116
2 жыл бұрын
Good video! Thanks for sharing!
@orenzbeda6072
2 жыл бұрын
Wil you try this: kzitem.info/news/bejne/lo2bzo6Kq5l4a6Q
@mingtindu123
3 ай бұрын
Very helpful video it is short and suit ❤❤🎉
@agix666
Жыл бұрын
I just followed this and it was great but when it was time for the logout I had issues with just *req.logout();* and *req.session.destroy();* As of 7/23 this worked instead req.logout((err) => { if (err) { res.send(err); } else { req.session.destroy((err) => { if (err) { res.send(err); } else { res.send('Logging out...'); } }); } });
@MunibDalati
7 ай бұрын
Thanks a lot!
@harounach
3 жыл бұрын
Thanks Kris for this video
@טלעמית-מ9כ
2 жыл бұрын
Great video, made it so easy. Tnx
@KrisFoster1
2 жыл бұрын
Thank you for the kind feedback & glad you enjoyed!
@ledeveloperstack7421
3 жыл бұрын
help, I get an error of type TokenError: client_secret is missing
@usmanshahid1557
2 жыл бұрын
bro if we login again after logged out ,then popup window did not appear ,why ?
@boot-strapper
2 жыл бұрын
2017 style express, niiiiice
@osamaayub405
5 ай бұрын
Cannot GET /auth/google/callback getting this error
@freddy9292
3 жыл бұрын
best tutorial 2021
@andriizilnyk4927
2 жыл бұрын
the best work bro, thanks a lot...
@chris0628
Жыл бұрын
Excellent tutorial 👍🏽
@jay_0906
Жыл бұрын
the best video I’ve ever seen👍
@w.cahyanto7924
2 жыл бұрын
Great tutorial video😀😀
@pritamdas1156
2 жыл бұрын
how do we use(logIn with google) password js with express js in react native
@poeeiphyu6931
3 жыл бұрын
Thanks for your sharing. great tutorial.
@elmasx
2 жыл бұрын
Hi Kris. How can we send to mongodb? Thanks
@thalist5522
2 жыл бұрын
Thank you so much!!!
@Grant094
Ай бұрын
great tutorial thank you!
@timlinator
3 жыл бұрын
When I click my auth link it just spins.
@KhemendraBhardwaj
Жыл бұрын
Thanks for the tutorial
@Robytsu
2 жыл бұрын
So no DB to save the session?
@Speztra
2 жыл бұрын
I love you for this.
@KrisFoster1
2 жыл бұрын
Thank you, glad you enjoyed!
@sanketkothiya547
Жыл бұрын
totally worth it 🔥🔥
@AndrewTSq
Жыл бұрын
i cant get it to work with private ip, how did you do that?.. google just blocks my request.
@IonizedComa
7 ай бұрын
make sure you assign test accounts to OAuth consent screen in google cloud platform, if your application is still in testing and not production it may only allow test account access
@vishaldinesh
Жыл бұрын
Hey kris thanks a lot man
@Dihan-fh5yx
10 ай бұрын
It works from browser, but I can't get it working from postman. Even after getting the access token and adding it to authorization header. Can anyone help?
@nazirkhan-jj8mz
6 ай бұрын
As you have to use your google account which is supposedly the logged in google account in your browser but not in postman. That's the reason its not working in the postman
@thinhle9325
Жыл бұрын
nice tutorial !!.😁
@bloggrammer
Жыл бұрын
Great video.
@dragtr0n
Жыл бұрын
Bro can you mentor me a little over discord? I am self taught. Just learnt mongoose node and express.
@RamBadrinathReddy
7 ай бұрын
thx man saved me
@ABUTAHER-wg7gz
2 жыл бұрын
But show req.user=undefined
@naderhany3639
6 ай бұрын
man you are awesome
@Mahir_Ahmad_MHR
Ай бұрын
SO GOOD ❤
@avinashparakhiya
2 жыл бұрын
you are grate
@valentin.stamate
11 ай бұрын
Well done
@UtkarshSingh_gt7
4 ай бұрын
Thanks man
@lukaakhalbedashvili7498
3 жыл бұрын
does this work in react ?
@tonienguix4834
3 жыл бұрын
react works well with express, yes
@DanOhCaptainDaniel
2 жыл бұрын
11:09 my nodemon keeps crashing for whatever reason. It doesn't like the passport.authenticate line
@DanOhCaptainDaniel
2 жыл бұрын
forgot to add const passport
@ameybelvalkar8877
3 ай бұрын
Awesome
@abhinavbabu1237
3 ай бұрын
👌
@DanOhCaptainDaniel
2 жыл бұрын
20:04, I am still unable to login..
@DanOhCaptainDaniel
2 жыл бұрын
got it, had to change the callbackURL to not include auth
@kodeeater
3 ай бұрын
thankyou
@andres201999
2 жыл бұрын
gracias bb
@orenzbeda6072
2 жыл бұрын
kzitem.info/news/bejne/lo2bzo6Kq5l4a6Q
@tomasonderco7324
Жыл бұрын
does anyone elses logout not work?
@docksfps
Жыл бұрын
I solved the logout problem with this : app.get("/logout", (req, res) => { req.logout(req.user, err => { if(err) return next(err); res.redirect("/"); }); });
@ImDino
3 жыл бұрын
this video is strangely high fps
@dadahossam3443
Ай бұрын
Bro u need to stop doing that sound with ur mouth!!!!!!!!!!!
@thecontinugouios
2 жыл бұрын
ummmm, hello brother. Sorry i just have a small critic for you but its ok, its a good video. But you don't need to copy paste the code. You need to code it from scratch so i can understand step by step.
@docksfps
Жыл бұрын
I solved the logout problem with this : app.get("/logout", (req, res) => { req.logout(req.user, err => { if(err) return next(err); res.redirect("/"); }); });
Пікірлер: 125