React SSO OAuth2.0 Login & Register | Login with Google w/ Express.js Server and Passport.js

Поделиться
HTML-код
  • Опубликовано: 28 окт 2024

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

  • @davidvivas8307
    @davidvivas8307 3 года назад +9

    After researching a lot, I have finished watching your videos two times because your explanations are so good. Thanks

  • @SanjuKumar-hk8yy
    @SanjuKumar-hk8yy Год назад +1

    Thanks man, this method is perfect when req.user is undefined after user login (by google, github or other services). I trying to solve req.user undefined before 2 days now today it is work for me.🙂🙂

  • @CristianPerez-yp6yj
    @CristianPerez-yp6yj Год назад

    Thank you very much for this contribution, it helps me a lot to start with passport and the backend, congratulations

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

    Very Cool Video! Keep up with good work. I look forward to another nice contents.

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

    Man, thank you so much. You helped me implementing google login in my next app. Ty!

  • @GhulamMuhammad-i3b
    @GhulamMuhammad-i3b Год назад

    Great Explanation, Highly Recommended.

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

    Seriously man You are awesome.. Just saved my day! Keep it up the good works❤️

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

    Thanks for this video I had watch so many but this one was the most detail and clear 🙏

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

    Great explanation! You helped a lot. But I have a question, if I am planning on deploying the app, would I need 2 domains? One for the react frontend and another one for the backend? Or how would the redirect work?

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

      No, you don't need two domains, but I'm not sure how to redirect.

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

      You don't need 2 domains.
      You can use subdomain instead.

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

    Your channel is amazing!

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

    what about the logout .does the logout means we have to delete the entries for the db of the loggedin user ? , also want the behavour of the logout here

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

    Can I use it for my react native application? . Do I have to remove the redirect url or what should I do

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

    what if I had to make this (API with Google SSO) for two client apps
    i.e. React website & React-Native Mobile App

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

    BROOOOOOOOOOO U SAVED ME I LOVE U

  • @m3mphi5r4r7
    @m3mphi5r4r7 3 года назад +3

    You saved my day !!! cheers

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

    I like the video tutorial, thanks.

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

    I loved this tutorial!! Thank you!!!

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

    Thank you. I've learned a lot. Can you tell me how to customize strategy by passport-oauth2,I want to use passport-oauth2 custom policy to do the system

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

    won't the user disappear after page refresh ?

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

    how can we access mobile number and address through when we make profile of user??

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

    Great tutorial and it helps a lot. Can you help me on how I can use azure ad instead of google? Thanks

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

    Very informative :)

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

    how your popup google window is closing ?

  • @ManiKandan-wi7ek
    @ManiKandan-wi7ek 3 года назад

    can I do the same step in the ember js framework? will it work?
    Reply ASAP

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

    Thanks a lot for this, cannot tell you how helpful this was

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

    callback url doesn't store user data in req. Can you help me?

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

    Very helpful

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

    thanks for this

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

    I don't get user info from backend after logging in.. why do you think it is?

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

      Have your cookies stored on the frontend?

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

    This is oauth login only not a sso.
    Sso and oauth are different concepts

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

    y r u using sql. Cant setup cus of it

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

    Thank you

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

    How many of you think he looks like Andrew Garfield(the actor in Amazing spiderman)

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

    not work in production

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

      i got no session after log in, probably because of different domain

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

      @@SaltyBoi420 Hi! I'm having the same problem. There is no session on the front-end side. My Backend request is trying to set cookies (I can see it in the headers), but ends up failing to do this. Have you solved this problem?

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

      @@alexvolkov529 Hi mate, yes i have solved it, so we cannot pass/set a cookie from A domain to B domain imagine we can do that internet will be a mess. So i use my backend on subdomain.A.id and my frontend on A.id and i can pass my jwt as cookie from backend to frontend, but only work on firefox. I believe it is an user agent (browser) problem. Cheers👍

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

      @@SaltyBoi420 Yes, thank you! It makes sense!

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

      @@alexvolkov529 i can provide you the project for reference if you want. But you know the problem is on production level😂👍

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

    make video on infinite scroll like instagram post, and skeleton loading screen. In MERN please

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

    The two codebases should be merged into one. The frontend and backend should be run under the same webserver, using just one port, so there should be no CORs policies needed...

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

      In the real world (i.e, a job), the separate server approach is much more common, for reasons like scalability and ease of deployment.

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

      In real life, they separate the code bases :)

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

    please buy a new mic and fix that echo...

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

    I have a problem with the window.closed. the newWindow object is changing to global for somereason so the newWindw.closed attribute is set to true like 200 ms after it opened even if it's still not closed. it seems to be a problem with the domain becasue when I use a webpage with localhost:3000 it works. Any workaround for this ? why is your code working out of the box ?

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

      The problem was helmet middleware for some reason.

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

      @@KingTom777 Same thing was happening to me. Because you were able to figure out it came from helmet, i went through the helmet middlewares to figure out which one was causing the issue. It is coming from helmet.crossOriginOpenerPolicy(). If you change the policy for this one, it will solve the issue:
      app.use(
      helmet({ crossOriginOpenerPolicy: { policy: "unsafe-none" } })
      );
      To answer your question, I don't know why his code worked out of the box without this workaround.

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

      Actually, this seems like it should be the default policy. So it makes sense that it would work for everyone else, but I can't figure why mine would be different.

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

    Finally a great explanation ! Thank you , A question I'm using jsonwebtoken in my email/password signup so after i wanted to add google SSO , is it okay to use the jsonwebtoken instead of passport.deserializeuser ?