NestJS & Google OAuth2 with Passport

Поділитися
Вставка
  • Опубліковано 25 лис 2024

КОМЕНТАРІ • 73

  • @ihorploskodnyak1294
    @ihorploskodnyak1294 2 роки тому +6

    You tutorials are amazing. Every time you are making them so easy to understand. Thanks for all your hard work. Bless you

  • @Squiel91
    @Squiel91 2 місяці тому

    Thank you for this fantastic so by step guide! ❤ I'll set it up this week for my platform, to push up signups. I'll write later how it goes.

  • @vaaaaaaaaan8678
    @vaaaaaaaaan8678 9 місяців тому

    Thankyou for everything!!, its amazing and you have a very clear explenations. I hope you do a lot more tutorials about nestjs

    • @ansonthedev
      @ansonthedev  9 місяців тому

      Thank you. I have a playlist with a lot of videos on Nest JS. Feel free to check it out here: ua-cam.com/video/nH9E25nkk3I/v-deo.html

  • @brangtoggez6363
    @brangtoggez6363 10 місяців тому

    This video is so good, with the code repository as well. You are a legend man.
    Passport in my opinion is a really library to learn since their documentations aren't that great. But your video clarify everything for me. again Thank you

    • @ansonthedev
      @ansonthedev  10 місяців тому

      Thank you and I'm glad you found this video helpful!

  • @thePINGUSTAR
    @thePINGUSTAR 8 місяців тому

    great tutorial, well explained - working great! I would love to see how I would go from here and authenticate a user in the frontend. And how to refresh tokens. Keep up the great work!

    • @ansonthedev
      @ansonthedev  8 місяців тому +1

      Thanks for the suggestion! :)

  • @keilerguardo2164
    @keilerguardo2164 2 місяці тому

    Thank you very much, this tutorial help me a lot.

  • @viktor_traveler
    @viktor_traveler Рік тому +1

    Thanks

  • @chillmelon7894
    @chillmelon7894 2 роки тому

    Dude this is awesome. Crystal clear!!

  • @nelsonjo14
    @nelsonjo14 5 місяців тому

    Thanks for the tutorial, very useful, greetings!!!

  • @AbdulRehman-pc2xx
    @AbdulRehman-pc2xx Рік тому

    Simply Amazing Tutorial I must say

  • @elcho911
    @elcho911 10 місяців тому

    Thank you!

  • @zaid4481
    @zaid4481 Рік тому

    You tutorials are amazing ,Thanks

  • @Liam02
    @Liam02 2 роки тому +3

    hello you tutorials are great. When logging google successfully, I want to redirect and return data for Frontend, I don't know you have any way, please help me ! Thanks

  • @amzfree
    @amzfree Рік тому +1

    Such a great tutorial. It really helps me a lot.

  • @TheMudioc
    @TheMudioc 2 роки тому +6

    Hello ! Thank you for the great insights, it helped me a lot, however I'm wondering what are accessToken and refreshToken for ? We're getting them but not doing anything with them...

    • @deadpoolweid
      @deadpoolweid Рік тому

      On the next user login, you need to use them to login user on google automatically, and retrieve his freshly profile data which could be edited.

  • @ВладимирГоворов-о3г

    Thanks a lot, it was a really useful lesson)

  • @volkswagenpassat-w3o
    @volkswagenpassat-w3o 8 місяців тому

    Great video! Many thanks :)

  • @homelander973
    @homelander973 Рік тому

    thank you very much, it was pretty useful material^^)

  • @cr7forever7877
    @cr7forever7877 Рік тому +1

    what theme are you using?

  • @thaingocnguyen1015
    @thaingocnguyen1015 Рік тому +1

    Hi thank you for amazing video. In my case I want to use JWT instead of session with this strategy, is this possible to do that? I have done some research but it's seem impossible

  • @huyhoanginh2525
    @huyhoanginh2525 4 дні тому

    how to use this api in fontend react?please,help me

  • @salahadindinsafa7657
    @salahadindinsafa7657 2 роки тому

    Thank you sir it was useful !!

  • @FaberJoo
    @FaberJoo Рік тому

    Thanks Your course was very useful.
    I have a question, how do I add multiple social logins, including google social logins??

  • @AbdulRehman-pc2xx
    @AbdulRehman-pc2xx Рік тому

    Amazing tutorial @Anson the Developer may I know your vs code theme

    • @ansonthedev
      @ansonthedev  Рік тому

      Horizon Theme - marketplace.visualstudio.com/items?itemName=alexandernanberg.horizon-theme-vscode

    • @AbdulRehman-pc2xx
      @AbdulRehman-pc2xx Рік тому

      Thanks brother@@ansonthedev can I have your linkedin please

  • @SocialChain-dn8of
    @SocialChain-dn8of Рік тому

    thank you very match 👍👍👍👍👍👍👍👍

  • @sdsim1
    @sdsim1 2 роки тому

    Hi, thanks for the video

  • @izuchukwusamson3150
    @izuchukwusamson3150 Рік тому

    Thank you for this wonderful tutorial.
    It really helped.
    Also, I tried joining your discord server but the link is invalid

  • @belkocik
    @belkocik Рік тому

    How to do it with a JWT instead of a session?

  • @s1dev
    @s1dev Рік тому

    I am having a hard time implementing the frontend for this code, in react as the react server runs in different port, can you help me out?

  • @NOBODYxx09
    @NOBODYxx09 Рік тому

    should we use token passed authentication or sessions with OAuth2 ?

  • @s1dev
    @s1dev Рік тому

    will userRepository work the same if I am using something like prisma instead of TypeORM?

    • @ansonthedev
      @ansonthedev  Рік тому +1

      Well, out of the box, no, but the idea of a Repository Pattern is not specific to a package or ORM. I would suggest looking into it on Google and seeing if you can find examples or research articles, because it's a lot to talk about in a youtube comment section.

  • @timofeybabisashvili7077
    @timofeybabisashvili7077 Рік тому

    Hey! Great tutorial. In the end of this video you promise to show to make it with other social media, but i can find any video with the same code. Can anyone send me a link, please? :)

  • @georgy2763
    @georgy2763 Рік тому

    Hi, can you please help me?) how to test this flow in postman? Redirect doesn’t work for me in postman, so I can’t call my endpoints with Google oauth from there. It would be good if you could explain it)thanks

    • @jambojambo1
      @jambojambo1 Рік тому

      same question here, did you find a solution?

  • @rabbysinjp1841
    @rabbysinjp1841 2 роки тому

    Solution please

  • @theflyingdutchman3942
    @theflyingdutchman3942 2 роки тому +1

    What do you mean by updating the user when it is found?

    • @ansonthedev
      @ansonthedev  2 роки тому +2

      When you find the user, the user saved in the DB might have stale data (profile pic, display name) because they could be changed by the user through Google. So if you want to reflect those changes you need to update the user.

    • @theflyingdutchman3942
      @theflyingdutchman3942 2 роки тому

      @@ansonthedev loud and clear thanks!

  • @AbdulRehman-pc2xx
    @AbdulRehman-pc2xx Рік тому

    @anson I have a quick question I am uisng mongodb with mongoose, when I dont find the user i need to register it now I dont have the password of user from google details .
    How may i store the user to my database
    1 How to create jwt token eiter I use access token provided by the oAuth but if i use it it will not pass my jwt strategy
    i have little confusion here Please guide me thanks in advance

    • @ansonthedev
      @ansonthedev  Рік тому

      Look at 1:07:18, inside the auth.service.ts file, specifically the validateUser method. This method is called from the GoogleStrategy.ts file's validate method. If the user is not found, it will create one and return it. You don't need to worry about the password.

    • @AbdulRehman-pc2xx
      @AbdulRehman-pc2xx Рік тому

      @@ansonthedevbut what about the token do i need to create new token with jwt or use the google provided accesstoken
      and in my user model I made password is required

    • @ansonthedev
      @ansonthedev  Рік тому

      The token is for auth, so yes you will

  • @Orlan2893
    @Orlan2893 Рік тому

    Hello somebody can help me with refreshtoken error

  • @theflyingdutchman3942
    @theflyingdutchman3942 2 роки тому

    Do you nee to setup a specific account to use as a test account for google cloud console? I cant seems to get an access token....
    The user is being added to te database and I successfully retrieve the data form the database from the app, thx in advance!

  • @truongkhanguyen6241
    @truongkhanguyen6241 8 місяців тому

    i facing an issue:
    Access blocked: Authorization Error
    Missing required parameter: scope Learn more about this error
    If you are a developer of TECHBLOG COMMUNITY, see error details.
    Error 400: invalid_request
    I have added email tests. I tried searching but there was no such error

    • @truongkhanguyen6241
      @truongkhanguyen6241 8 місяців тому

      It seem the library not working with nestjs anymore 😢

    • @ansonthedev
      @ansonthedev  8 місяців тому +1

      It's not an issue with the library. You're missing the scope which is required.

    • @truongkhanguyen6241
      @truongkhanguyen6241 8 місяців тому

      ​@@ansonthedev you are right, just missing scope. But it must be declared inside the guard file instead of strategy file. Most tutorials do not mention this issue

  • @SocialChain-dn8of
    @SocialChain-dn8of Рік тому

    best video🤘👍👍👍👍

  • @rabbysinjp1841
    @rabbysinjp1841 2 роки тому

    Tool use Google OAuth2

  • @rabbysinjp1841
    @rabbysinjp1841 2 роки тому

    Hello sir

  • @rabbysinjp1841
    @rabbysinjp1841 2 роки тому

    Please help me

  • @rabbysinjp1841
    @rabbysinjp1841 2 роки тому

    My account is hack

  • @AliAliOxenFree
    @AliAliOxenFree Рік тому

    this is yet another excellent tutorial. by far the best teacher on YT. thanks a bunch for these vids buddy, never stop!
    also, at minute 54:00 the findOne method works like this:
    const user = await this.userRepository.findOne({
    where: { email: details.email },
    });

  • @potantirittisak8494
    @potantirittisak8494 4 місяці тому

    Thank you!

  • @oussemachercheri9355
    @oussemachercheri9355 2 місяці тому

    Thank You!