Комментарии •

  • @jeanlucas9702
    @jeanlucas9702 Год назад +7

    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

  • @crazedbrazy617bh
    @crazedbrazy617bh 2 года назад +6

    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!

  • @ilanle
    @ilanle Год назад +3

    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

  • @tonienguix4834
    @tonienguix4834 2 года назад +43

    one of the best code tutorials I've ever watched. Clear, concise and simple. Fantastic video 👏

    • @KrisFoster1
      @KrisFoster1 2 года назад +1

      Thank you for the kind words!

    • @tonienguix4834
      @tonienguix4834 2 года назад

      @@KrisFoster1 hey Kris! sorry I sent you a question on twitter. How can I send the user object to the client? thank you!

    • @orenzbeda6072
      @orenzbeda6072 2 года назад

      try this one: ruclips.net/video/5WehZTrgG8o/видео.html

    • @uk4876
      @uk4876 2 года назад

      Yeah I agree

    • @anfaenfpanthqwefbdas
      @anfaenfpanthqwefbdas Год назад

      Absolutely, straight to the point and no waste of time

  • @arnabbanik6403
    @arnabbanik6403 2 года назад +7

    Really amazing tutorial, actually the only one where I understood what each part of the code was doing.

  • @LeighBriody
    @LeighBriody Год назад +1

    Such a lack of videos explaining this topic , thank you man !

  • @GlitchedFailure
    @GlitchedFailure 5 месяцев назад +2

    To the point, goes step by step. Well done!

  • @codingrussell138
    @codingrussell138 2 года назад +10

    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
      @KrisFoster1 2 года назад +2

      That's great to hear @Dev Dev Goose. Well done!

    • @immensives147
      @immensives147 2 месяца назад +1

      Damn 🙄

  • @immensives147
    @immensives147 2 месяца назад +1

    Other than him, no one was helpful to me for this particular problem, Thanks Man 👍

  • @itsnobledean9450
    @itsnobledean9450 6 месяцев назад

    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.

  • @Bl4sTTer
    @Bl4sTTer 2 года назад +1

    Most helpful video I found about OAuth2 with Node.
    Thank you

  • @firojsiddiki2750
    @firojsiddiki2750 3 года назад +2

    Simplest Code and Simplest explanation. awesome

  • @abdulsamihamedi5584
    @abdulsamihamedi5584 6 месяцев назад +1

    it helped me bro, always keep your tutorials as clear as this!!!

  • @dremmaokoh5011
    @dremmaokoh5011 Год назад +2

    Great video. Short and precise . Thanks alot

  • @haoyuandong
    @haoyuandong 3 года назад +5

    Thanks for this simple but clear video.

  • @codinginflow
    @codinginflow 2 года назад +2

    Thank you, this helped me a lot

  • @DEV_XO
    @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!

  • @dwijvirani7919
    @dwijvirani7919 2 года назад

    Thanks bro for the detailed explanation. It was a great help

  • @generalknow_ledge
    @generalknow_ledge 8 месяцев назад

    Your explanation is awesome dude thankyou very much for the knowledge ❤

  • @taufiksatya9695
    @taufiksatya9695 11 месяцев назад

    You're the best explain for this mate.

  • @TOMGAMING-hy9hi
    @TOMGAMING-hy9hi 2 года назад +1

    a very big big thanks to you sir for giving such an amazing explanation.............!!!!!!!!!!

    • @orenzbeda6072
      @orenzbeda6072 2 года назад

      Maybe you will like this also so much simpler: ruclips.net/video/5WehZTrgG8o/видео.html

  • @ayhamahmad6184
    @ayhamahmad6184 2 года назад +1

    Thank you so clear explaining

  • @indraargamuria4774
    @indraargamuria4774 2 года назад

    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!

  • @blacktipe9922
    @blacktipe9922 2 года назад

    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?

  • @harounach
    @harounach 3 года назад +1

    Thanks Kris for this video

  • @mingtindu123
    @mingtindu123 17 дней назад

    Very helpful video it is short and suit ❤❤🎉

  • @info662
    @info662 2 года назад

    Subscribed!
    Hey, what if I wanted to return a token instead of a session id?

  • @poeeiphyu6931
    @poeeiphyu6931 3 года назад

    Thanks for your sharing. great tutorial.

  • @andriizilnyk4927
    @andriizilnyk4927 2 года назад +1

    the best work bro, thanks a lot...

  • @andrews13
    @andrews13 3 месяца назад

    So, will the Node.js application use the email address as some Primary Key in the database to identify a user?

  • @vidyashet800
    @vidyashet800 5 месяцев назад

    Was so confused with Google Auth, Thank you so much for this wonderful tut

  • @freddy9292
    @freddy9292 3 года назад +1

    best tutorial 2021

  • @user-gv2cj5so6q
    @user-gv2cj5so6q 2 года назад +1

    Great video, made it so easy. Tnx

    • @KrisFoster1
      @KrisFoster1 2 года назад

      Thank you for the kind feedback & glad you enjoyed!

  • @jay_0906
    @jay_0906 9 месяцев назад

    the best video I’ve ever seen👍

  • @chris0628
    @chris0628 Год назад

    Excellent tutorial 👍🏽

  • @pritamdas1156
    @pritamdas1156 2 года назад

    how do we use(logIn with google) password js with express js in react native

  • @omarruder4129
    @omarruder4129 7 месяцев назад

    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?

  • @harpuneetkalsi5960
    @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??

  • @sanketkothiya547
    @sanketkothiya547 Год назад

    totally worth it 🔥🔥

  • @kelwong116
    @kelwong116 2 года назад +1

    Good video! Thanks for sharing!

    • @orenzbeda6072
      @orenzbeda6072 2 года назад

      Wil you try this: ruclips.net/video/5WehZTrgG8o/видео.html

  • @ledeveloperstack7421
    @ledeveloperstack7421 3 года назад

    help, I get an error of type TokenError: client_secret is missing

  • @boot-strapper
    @boot-strapper 2 года назад

    2017 style express, niiiiice

  • @willysnowman
    @willysnowman 2 года назад +4

    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
      @avalancherelapse Год назад

      very important comment here, thank you! kris foster should pin this!!!

    • @marcofari532
      @marcofari532 3 месяца назад

      Yes req.logout() needs a callback

  • @Robytsu
    @Robytsu Год назад

    So no DB to save the session?

  • @w.cahyanto7924
    @w.cahyanto7924 2 года назад

    Great tutorial video😀😀

  • @thalist5522
    @thalist5522 Год назад +1

    Thank you so much!!!

  • @usmanshahid1557
    @usmanshahid1557 Год назад

    bro if we login again after logged out ,then popup window did not appear ,why ?

  • @Speztra
    @Speztra 2 года назад +1

    I love you for this.

    • @KrisFoster1
      @KrisFoster1 2 года назад

      Thank you, glad you enjoyed!

  • @user-ky1ug2ex5x
    @user-ky1ug2ex5x Год назад

    Thanks for the tutorial

  • @atv8992
    @atv8992 3 года назад

    InternalOAuthError: Failed to obtain access token
    why am i getting this?

  • @kirillpavlovskii8342
    @kirillpavlovskii8342 2 года назад +1

    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
      @orenzbeda6072 2 года назад

      This is simpler: ruclips.net/video/5WehZTrgG8o/видео.html

  • @yabuking84
    @yabuking84 2 года назад +1

    Question: why do you need to serialize or deserialize user data? stated at 8:47? Thanks

    • @samart3010
      @samart3010 2 года назад +1

      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
      @IonizedComa 4 месяца назад

      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

  • @user-yn4qr7hu9r
    @user-yn4qr7hu9r 3 месяца назад

    thx man
    saved me

  • @timlinator
    @timlinator 2 года назад

    When I click my auth link it just spins.

  • @naderhany3639
    @naderhany3639 3 месяца назад

    man you are awesome

  • @vishaldinesh
    @vishaldinesh Год назад

    Hey kris thanks a lot man

  • @paritoshpanigrahi007
    @paritoshpanigrahi007 6 дней назад

    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.

  • @cookie2glue
    @cookie2glue Год назад

    10:21 The silence here killed me lol

  • @elmasx
    @elmasx Год назад

    Hi Kris. How can we send to mongodb? Thanks

  • @thinhle9325
    @thinhle9325 Год назад

    nice tutorial !!.😁

  • @osamaayub6004
    @osamaayub6004 2 месяца назад

    Cannot GET /auth/google/callback getting this error

  • @bloggrammer
    @bloggrammer Год назад

    Great video.

  • @W_Wadu
    @W_Wadu 9 месяцев назад

    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
      @W_Wadu 9 месяцев назад

      And how does express-session solve this?

    • @artax5005
      @artax5005 9 месяцев назад +1

      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) ruclips.net/video/F-sFp_AvHc8/видео.html.

    • @W_Wadu
      @W_Wadu 9 месяцев назад +1

      @@artax5005 Wow this helps, thank you so much

  • @valentin.stamate
    @valentin.stamate 7 месяцев назад

    Well done

  • @auinspiration03
    @auinspiration03 2 года назад +1

    you are grate

  • @Dihan-fh5yx
    @Dihan-fh5yx 6 месяцев назад

    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
      @nazirkhan-jj8mz 3 месяца назад

      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

  • @juanisidorogarcia1699
    @juanisidorogarcia1699 2 года назад +4

    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!

  • @UtkarshSingh_gt7
    @UtkarshSingh_gt7 29 дней назад

    Thanks man

  • @ABUTAHER-wg7gz
    @ABUTAHER-wg7gz 2 года назад

    But show req.user=undefined

  • @abhinavbabu1237
    @abhinavbabu1237 3 дня назад

    👌

  • @AndrewTSq
    @AndrewTSq Год назад

    i cant get it to work with private ip, how did you do that?.. google just blocks my request.

    • @IonizedComa
      @IonizedComa 4 месяца назад

      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

  • @lukaakhalbedashvili7498
    @lukaakhalbedashvili7498 3 года назад

    does this work in react ?

  • @dragtr0n
    @dragtr0n Год назад

    Bro can you mentor me a little over discord? I am self taught. Just learnt mongoose node and express.

  • @tomasonderco7324
    @tomasonderco7324 Год назад

    does anyone elses logout not work?

    • @docksfps
      @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("/");
      });
      });

  • @DanOhCaptainDaniel
    @DanOhCaptainDaniel 2 года назад

    20:04, I am still unable to login..

    • @DanOhCaptainDaniel
      @DanOhCaptainDaniel 2 года назад

      got it, had to change the callbackURL to not include auth

  • @andres201999
    @andres201999 2 года назад

    gracias bb

    • @orenzbeda6072
      @orenzbeda6072 2 года назад

      ruclips.net/video/5WehZTrgG8o/видео.html

  • @DanOhCaptainDaniel
    @DanOhCaptainDaniel 2 года назад

    11:09 my nodemon keeps crashing for whatever reason. It doesn't like the passport.authenticate line

  • @ImDino
    @ImDino 2 года назад

    this video is strangely high fps

  • @thecontinugouios
    @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.

  • @agix666
    @agix666 11 месяцев назад +1

    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...'); }
    });
    }
    });

  • @docksfps
    @docksfps Год назад +1

    I solved the logout problem with this :
    app.get("/logout", (req, res) => {
    req.logout(req.user, err => {
    if(err) return next(err);
    res.redirect("/");
    });
    });