Login / Signup / SignIn with Google GSI | OAuth2.0

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 ต.ค. 2024

ความคิดเห็น • 28

  • @wordrc
    @wordrc ปีที่แล้ว +2

    I was completely stuck until i found this video, thank you so much, it works so well

  • @storyzcreator
    @storyzcreator 2 หลายเดือนก่อน

    why wouldn't we need the csrf verification when we go the js callback route that give us the credentials? How is the csrf taken care of then?

  • @piccininsouza
    @piccininsouza ปีที่แล้ว +3

    Hello buddy! You just save the day... the Google Documentation really sucks.... really, really thank you

    • @ConsultingNinja
      @ConsultingNinja  ปีที่แล้ว

      I am so glad you found this helpful! I 100% agree the documentation for this there is terrible and frequently incorrect. I appreciate you taking the time to tell me it helped you!

    • @mattwest4083
      @mattwest4083 ปีที่แล้ว

      the docs are surprisingly disorganized, i don't understand why it doesn't give examples and constantly switches contexts between different approaches

    • @ConsultingNinja
      @ConsultingNinja  ปีที่แล้ว

      Even the bits it gives doesn't match what happens in reality. It is truly awful to work with. If this helped you consider a super thanks to support more videos like this.

  • @dmitrymalkov6189
    @dmitrymalkov6189 ปีที่แล้ว

    Thank you very much! Everything works fine in chrome, but when clicking google sign in button in Firefox or Safari (iOS) the consent popup doesn't appear. I am stuck with this problem, maybe you can help

    • @ConsultingNinja
      @ConsultingNinja  ปีที่แล้ว

      I have a bunch going on so can only offer that level for free. If you have a short specific question I will do my best to answer it.

  • @revrenlove
    @revrenlove ปีที่แล้ว +1

    GSI = Google Sign In

    • @ConsultingNinja
      @ConsultingNinja  ปีที่แล้ว +1

      Yeah that is what I figured, but their documentation keeps calling it Sign in With Google. developers.google.com/identity/gsi/web/guides/overview
      Check it out here, over and over. The acronym makes sense for sure, but they should update their docs to reflect that! lol

  • @slvnyaswanth
    @slvnyaswanth 10 หลายเดือนก่อน

    Is it possible to check user signed out from gmail when they are signed in using gmail

    • @ConsultingNinja
      @ConsultingNinja  10 หลายเดือนก่อน

      I am not 100% sure what you are asking? When you say gmail do you mean Google? Gmail is just an email service of Google.
      A user has to be signed into to generate a credential. If they are not signed in when they click the button it will ask them to select their account AND enter their password for that account, sign them in and then give you back the credential.
      If they sign in using OAuth2 and then sign out of Google the access token generated will probably die with that sign out ,but the refresh token would live on and you could just generate a new access token with that refresh token.
      I hope that helps.
      Mitch (CN)

    • @slvnyaswanth
      @slvnyaswanth 10 หลายเดือนก่อน

      @@ConsultingNinja tnx for reply my question id lets say user sign in eith google account using 0auth google sign in. How do I known that if user signs out from that acc in another tab while using the the app .
      Can u pls explain logic or code for that to manage the user such that when they logout I need to stop the user using the app . like sessipn mgmt

  • @sarthakbatham7883
    @sarthakbatham7883 11 หลายเดือนก่อน

    Underrated video!

  • @twd2
    @twd2 ปีที่แล้ว

    Bro, I think Authjs has a lot of exciting functionals for authentication and authorization (JWT, refresh Token, rotation token, Social media login and a lot of providers , MongoDB sessions...ETC, and there's no content for Svelte, and the documentation is not that good for Svelte !!!

    • @ConsultingNinja
      @ConsultingNinja  ปีที่แล้ว

      AuthJs seems pretty cool, I honestly haven't used it. But I have looked at it and it is not surprising that the docs suck for Svelte. It is just in the "experimental" phase. They are even saying the API WILL change. So I probably will wait a little bit before i would invest a ton of time in it, but certainly can play around. I am loving PocketBase right now for auth. I will be releasing a video on this soon.

    • @twd2
      @twd2 ปีที่แล้ว

      Ya, it's in an experimental phase, but I think it's quite stable, yesterday I tried the MongoDB session provider and it was great and with a few lines of code with (hooks server file) PocketBase, also a great choice, plus it's Svelte code base, but to be honest I did not try it before, but I think,AuthJs has a lot of options when it comes to app security management, and it's in a beta version.

    • @ConsultingNinja
      @ConsultingNinja  ปีที่แล้ว

      Now you have me curious. I will have to check it out lol

    • @twd2
      @twd2 ปีที่แล้ว

      Trust me it worths 😉 !!!

  • @aada5121
    @aada5121 9 หลายเดือนก่อน

    how i can sign out ? can you provide the code in the comment

    • @ConsultingNinja
      @ConsultingNinja  8 หลายเดือนก่อน

      Hey sorry this was not showing up for some reason. If you are using the client to pass auth to front end then you would use oAuth2Client.revokeToken(user.access_token). If you are also using cookies then you would need to clear those as well.
      Hope that helps!
      Mitch(CN)

    • @aada5121
      @aada5121 8 หลายเดือนก่อน

      it would be great if you share the logout code in the comment @@ConsultingNinja

    • @ConsultingNinja
      @ConsultingNinja  8 หลายเดือนก่อน +1

      oAuth2Client.revokeToken(user.access_token)

  • @CasualVloggingGoneSerious
    @CasualVloggingGoneSerious 6 หลายเดือนก่อน

    I can totally agree, google's documentation is the worst!

  • @sarthakbatham7883
    @sarthakbatham7883 11 หลายเดือนก่อน

    Underrated video!

    • @ConsultingNinja
      @ConsultingNinja  11 หลายเดือนก่อน

      I feel the same way lol