Simple React.js User Login Authentication | Auth0

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

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

  • @codeSTACKr
    @codeSTACKr  4 года назад +1

    👉 Sign up for my newsletter to stay up-to-date on my new course:
    codestackr.com

  • @BlockCylinder
    @BlockCylinder 2 года назад +12

    Really well done. I'm following this tutorial nearly two years later, and I'm integrating Auth0 into an existing React application, and it went smoothly from start to finish. We all know how rare that is, even with more recent clips from mainstream channels.

    • @AyanKhan-dc3eu
      @AyanKhan-dc3eu 2 года назад +1

      please help me out my react app on desktop is working fine but on android browser its a blank white screen after using auth0

  • @albert21994
    @albert21994 4 года назад +76

    you, mate, saved my freelance carreer.

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

      mine as well

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

      hey can you help me to get freelance react and next js projects ?

    • @albert21994
      @albert21994 3 года назад +15

      @@compilexfaiz ​ @Muhammad Faiz Khan React/next alone isn't gonna cut it. Networking is my most successful way of getting gigs; I even get messaged on LinkedIn if your CV is promising. - You need to sell solutions, not your skill set. A client doesn't care about what React/NextJS is; he cares about how you develop his vision, which is mostly a fancy/minimal website experience.
      Skilled Frontend Dev's are in demand. Several RUclips channels are even advertising for positions.
      I imagine most clients feel more comfortable, with the following:
      - Excellent English because a client needs to feel comfortable with you communicating in a way that avoids misunderstandings.
      - Computer Science Degree (finished, enrolled, or similar): Despite everything you hear on YT or read online on course websites, most clients don't wanna work with beginners. They think of a degree as something as a "proof of competence." It helped me a lot with more conservative, higher-paying jobs.
      - Portfolio / Open-Source Contributions: As said, showing you are not a beginner, like the other guys on Fiverr or similar, by showing off how competent you are in a Portfolio assures a client can know what he's getting from you. Most of them don't bother with the portfolio, but it's a way of taking confidence in your work. - People notice that.
      Open Source Contributions can build your portfolio significantly. Even more, if they're on big projects. Also, they are a good way of networking.
      tl;dr show off your work and use your soft skills. Networking lands most jobs.

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

      @@albert21994 thanks....above information is really helpful.....

  • @JamesQQuick
    @JamesQQuick 4 года назад +29

    I'm biased but this video was great!! Auth0 makes auth in React so easy :)

  • @khandoor7228
    @khandoor7228 4 года назад +9

    Stackr this was awesome. I think you just saved me years of my life not having to write all that authentication!!! You continue to impress with your code and delivery. So many people making these videos don't have (or don't know how to use) plugins and autocomplete and up to date syntax and it makes watching their videos frustrating (due to it taking so long to do simple things) but your code and syntax is up to date and on point. So not only do I learn the topic but pick up a few tips and tricks as well!! Awesome job man!!

    • @codeSTACKr
      @codeSTACKr  4 года назад +1

      Thank you! I appreciate that!

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

      @@codeSTACKr hi , thanks for thr content and I want to know if it's totally free

  • @ioannispotouridis297
    @ioannispotouridis297 3 года назад +7

    Just wrap your code in you don't need extra packages for formatting the JSON 😁

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

    I have had issues with auth for a while and this tutorial has made it simple to add it to my future react apps. Thanks for this!

    • @AyanKhan-dc3eu
      @AyanKhan-dc3eu 2 года назад

      please help me out my react app on desktop is working fine but on android browser its a blank white screen after using auth0

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

    Brilliant content! No need to speed up the video... you go at a great speed by default.

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

    Liked the video, subscribed, want to learn more about authentication! Thanks man!

  • @eleah2665
    @eleah2665 4 года назад +6

    Yes, more about authentication. Thanks.

  • @abhisekray9622
    @abhisekray9622 4 года назад +9

    hello sir why my domain and clientId is undefined after using the .env file

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

      You need to restart server after every change in .env file. So if your server was running and u created .env file after that just npm start again

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

    Great tutorial and OAuth is a great technology. One note of caution - your API keys can be viewed by anyone, (even in the .Env file) using the browser tools if you put your site live, which is a security no no.
    In production the keys would be hidden on the back end and served up to the front end via an API. You can also look into hiding your API keys in React to find solutions, most of which will involve making a simple back end to store and serve the keys.

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

    I just bumped into this tutorial and it was awesome! To be honest, it’s clearer than auth0 docs.
    Thanks for sharing

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

    Super clear, super good audio. I love you

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

    Great video thank you so much. This react auth is a turn on and is helping me want to learn more (again) about react for building something with a login. You rock bud.

  • @ruballa27
    @ruballa27 4 года назад +1

    great job - with so many of these types of vids out there, yours stands out

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

    Yes yes, more auth videos pleaseeeeeeee... This was really great,

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

    Very easy explanation and best video out there. Thank you man.🙌

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

    @8:50. anyone else get stuck here? it keeps telling me my credentials to login are invalid even though I am using them to login on a different tab in the same browser

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

    Random question, but what VSCode theme are you using? Really dig the colors!

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

    amazing solution! my new goto for react auth components

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

    Love this video!!! Thank you for making it easy to understand!!

  • @SuhweeSoftware
    @SuhweeSoftware 4 года назад +3

    Hello, so I am at 9:05 and I am trying to hit login but it loads slowly and then I get a server not found error. I believe it has to do with the redirectUri={window.location.origin} in the index.js. Do you now this issue or how to troubleshoot it?

    • @SuhweeSoftware
      @SuhweeSoftware 4 года назад

      I cloned the GitHub repository and added my info to the .env. Still the same error

    • @bendechrai
      @bendechrai 4 года назад +1

      Hi @@SuhweeSoftware. When that happens to me, it's usually the domain parameter in the Auth0Provder that's not being passed in properly. If you check the console log, you might see what URL it's actually trying to go to, and it might be undefined/...
      Double check the value is being pulled in from the .env file (you'll need to stop and restart the node server to reload any changes) 🍀

    • @codeSTACKr
      @codeSTACKr  4 года назад +1

      Thanks for answering this! Caleb, let us know if you are still having issues :)

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

      @@bendechrai Ah. So I fixed the domain and clientId paramater. I had dashes '-' in the code but in the .env file I had underscores _. Now a webpage loads at least but it is saying. "oops something went wrong; callback URL mismatch". I went and checked the Auth0 cite and I still have the correct information in the boxes so not sure now.

    • @bendechrai
      @bendechrai 4 года назад

      @@SuhweeSoftware yay for progress! Okay, if you look in the logs from the Auth0 dashboard you should see the message that tells you what it's getting. How does that differ from what it's expecting?

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

    What editor and font theme is that? Really nice

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

      Cobalt2 and Fira Code Font

    • @realsemig
      @realsemig 4 года назад

      @@codeSTACKr Thanks you!

  • @TheWandererDoc
    @TheWandererDoc 4 года назад

    so what is related to JWT ? or its the same we can use jwt or auth0

  • @FernandoSouza-yj3xl
    @FernandoSouza-yj3xl 4 года назад +3

    I have some questions:
    - How user section keep active when page is realoaded? Does Auth0 React handle this or should you do it by yourself?
    - If i have a rest API in a totally different domain, how can i handle this? I need to send something like a header to this API. And this API should be able to validade this header.
    I really want to see more about Auth0

    • @FernandoSouza-yj3xl
      @FernandoSouza-yj3xl 4 года назад

      User session I mean

    • @codeSTACKr
      @codeSTACKr  4 года назад +8

      Those are defiantly more advanced features of Auth0. I can create a video on it.

    • @khandoor7228
      @khandoor7228 4 года назад

      @@codeSTACKr Im in!!

    • @RNMERIA
      @RNMERIA 4 года назад

      @@codeSTACKr that would be an excellent follow up

    • @bacon37460
      @bacon37460 4 года назад

      @@codeSTACKr Is there any feedback for this?

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

    Best, concise video on the topic. Subbed 👍

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

    This video is really great. Easy to understand. I will definitely build up a sample application using Auth0.

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

    Thank you... You're content is my favourite!!! Youre giving us the best stuff right now!!! Thank you again!

    • @codeSTACKr
      @codeSTACKr  4 года назад

      Wow, thank you!

    • @khandoor7228
      @khandoor7228 4 года назад

      @@codeSTACKr Agreed you are doing a super job right now!!!

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

    application is starting well ,but after log in it is not loading the next respective page ,please help

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

    Hey mate , in console after clicking login button it shows,Loginwithredirect is not a function

  • @AyanKhan-dc3eu
    @AyanKhan-dc3eu 2 года назад +1

    my react app on desktop is working fine but on android browser its a blank white screen after using auth0. please help me out

  • @shadmerhi
    @shadmerhi 4 года назад +6

    This is an amazing video! How do you retrieve the form contents if the user decides to login by manually creating an account? I'd love to see more Auth0 videos from you.

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

    there you have it.. explained very well.. it seems to me that its like offloading your users data to a third party in exchange of flexibility the question is as a developer do you want that?

  • @salesman-z9w
    @salesman-z9w 3 года назад +1

    wow Auth0 looks so good

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

    Great tutorial! A video about protected routes using react-router would be nice

  • @nischalrapireddy
    @nischalrapireddy 4 года назад +1

    How did u make your Vscode like the smooth thing like whenever u type or delete Code it's smooth how to do that??

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

      Just have a good pc 😅 I guess

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

      @@chitrangsharma uhm I have Ryzen 7 2700x and GTX 1660 super I guess that's a good pc 😅😅😅

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

    BESTTT

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

    Thanks for this, appreciate it!

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

    Can u please post more about auth0 , this short tutotrial was amazing

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

    Yes please. More authentication material. Much appreciated!

  • @venusirpuram4345
    @venusirpuram4345 4 года назад

    I have a doubt, I didn't understand what you at 16:20.
    Can you please explain

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

    Is there anymore use cases for things such as Auth0 like chat rooms and such?
    Or permissions and admin panel access?
    I’m just curious as to how to deploy such things.

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

    How easy it was ! Thank you very much ❤️.

  • @shangshi6286
    @shangshi6286 4 года назад

    Thank you! Why at 12:35, I don't see the false displayed in the browser? I console.log (user) but it's showing me undefined. I wondering why the "false" isn't showing up on my screen.

    • @shangshi6286
      @shangshi6286 4 года назад

      something must have changed in the Auth0 API, I'm enable to see the return value after I log in. but if I'm logged out, I'm not able to see anything with JSON.stringify(user)

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

    Perfect, working great. Really nice tutorial!

  • @joelgarcia8916
    @joelgarcia8916 4 года назад

    Easy and integrated in electron thanks buddy !

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

    Who could possibly dislike this video? Ridiculous.

  • @hambaba
    @hambaba 4 года назад

    what is the snippet extension that you used? and how did you automatically imported the components too? are those from the same extension?

    • @joelgarcia8916
      @joelgarcia8916 4 года назад

      dsznajder.es7-react-js-snippets

    • @codeSTACKr
      @codeSTACKr  4 года назад

      The snippets are from the extension Joel Garcia mentioned. The auto import is just built into VS Code. Start typing the component and it will import it.

    • @hambaba
      @hambaba 4 года назад

      Thanks everyone

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

    "site can't be reached" i did exactly what you did and when i click sign in, i get that message.

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

      same here... did you manage to resolve it?

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

      @@jedsalmon890 same here... did you manage to resolve it?
      Edit: I stopped my server, and npm started again and it worked.

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

    thank you soo...... much, it helped in my reactjs app, the code was literally so little

  • @vivianelauresop1611
    @vivianelauresop1611 4 года назад

    Nice tutorial! A video about login with github using OAuth would be nice

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

    Hi did you create a vids for Auth0 where you set up tenent settings, to allow someone to login using a HTMLRequest. To get that working you need to set up Default Audience and Default Directory. Auth0 documentaion seem very shy in explaining what they are. Thanks

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

    You just saved me hours. Thank you!

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

    Your VS Code theme?

  • @BrainWavesVillain
    @BrainWavesVillain 4 года назад +1

    This channel is awesome!

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

    Thanks ! By far the best , clear and easy tut . Quick question (generic) . When I deploy my app say on firebase , Can I still use .env file contents ? Will that still work ? Or should I be making any changes ?

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

    Great video. Super helpful

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

    Thanks for this video very simple to follow and packed with useful info

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

    Signin with Google causing 400 error it redirects to /authorize, but it works with user\password

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

    what if i want to use context js and wrap my app around AppProvider as well as auth0 ??

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

    this was pretty cool

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

    Brilliant, so simple and well explained.

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

    Hey I'm running into a problem when I click the log in button it can't reach the authentication page. What could be the problem. It says it's undefined in the url bar

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

    I love it, but i have a question, is possible to edit the login screen of auth0?

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

    Hi ....I have performed all the steps, on click of login button it is not routed to page , it is showing "This site can't be reached"

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

    How can you accomplish the same with a local DB using an API?

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

    Awesome 👍😀

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

    The problem is that you have to create a login button first for the Auth0 loging page to show up. Which is counter intuitive, you want users to arrive straight into the log in page, not another page with a login button you have to click, to then be redirected to the actual login page.

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

    Hi! Just wanted to know if do you have some resource or to utilize email address whitelist? Thank you very much.

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

    Thank you so much. Subscribed!

  • @wrushu
    @wrushu 4 года назад +1

    I followed the exact steps in tutorial, but the social connection signin is not working (Google...) give me Error 400

  • @cookiebinary
    @cookiebinary 4 года назад

    what a fancy cursor.. is it a plugin? and is it cross-IDE (JetBrains IDEs ..etc)?

    • @codeSTACKr
      @codeSTACKr  4 года назад +1

      It's just VS Code cursor settings

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

    Thank you Sir! Its working 😀

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

    Is it possible to use Auth0 to manage additional user info? For example, I'd like to offer a service through a monthly subscription through a web app. I could check whether or not the user has an active license by putting a "licenseExpirationTimestamp" or something like that alongside the user's info. Would you recommend using something else, maybe Firebase or MongoDB Atlas (or MongoDB self-hosted) or is it possible to do this with Auth0? I've looked into it, but since I'm new to React + Express Node.js I'm not really sure about what the optimal solution for my problem would be. Thanks!

  • @ProfessionalTycoons
    @ProfessionalTycoons 4 года назад +1

    very easy to follow and direct thanks

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

    can i somehow manage user roles (or other custom user attributes) in the registration itself?
    also, besides the obvious user object, can i store roles and other custom attributes in the local storage under the same user object?
    i'm trying to play with it and the code gets messy

  • @JASBIRSINGH-pj6xf
    @JASBIRSINGH-pj6xf 3 года назад +1

    Thanks . Informative video❤️

  • @acushlakoncepts
    @acushlakoncepts 4 года назад +1

    Great one, I love it

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

    This is great but my .env file isn't being read into the process.env object

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

      Also had this problem. npm i -D react-error-overlay@6.0.9 ... try downgrading this dependency... fixed it for me

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

    Is this implicit grant?

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

    wow! amazing tutorial! thank you so much!

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

    How do you set this up if you only want 1 user to be able to log in. For example if u want to access some hidden features of ur home page for maintenance etc... when I use the 0auth module it seems anyone can log in or register.

  • @bendechrai
    @bendechrai 4 года назад

    File me under biased too, but that was so clear and easy to follow. Thanks ❤

  • @hashimshah8035
    @hashimshah8035 4 года назад

    Theme?

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

    Thank you very much! your video is very helpful!

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

    Thank you! This helped so much!

  • @zlackbiro
    @zlackbiro 4 года назад

    What is the name of JSX autocomplete addon?

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

    I can't believe this company locked me out of the accounts I've created just because they want to make a sale for a big organization. I have wasted so much time on this only because they were controlling my inability to log in. I will post this again and again.

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

      you were locked out? can you explain? I am on the part where you first login and it keeps telling me my credentials are wrong even though I am using them to login in a different window in the same browser

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

    Hello sir I have an error in reactJs login authentication. How can I do

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

    If user signup in react application then how to make automatic login in wordpress account using sso please guide

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

    Hey, Thanks for this video, this helped me a lot! I'm forever grateful!

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

    does it still work if i don't buy the full version ?

  • @ShubhamSingh-bj3ms
    @ShubhamSingh-bj3ms 3 года назад

    my authorize page is not coming its givig error VM83:6770 crbug/1173575, non-JS module files deprecated. help

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

    Please, teach us more about Authentication. Regards!

  • @nitheshchinnappa9391
    @nitheshchinnappa9391 4 года назад

    what type of extensions and theme you are using..?

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

      Cobalt2 and the snippets are: marketplace.visualstudio.com/items?itemName=dsznajder.es7-react-js-snippets

    • @codeSTACKr
      @codeSTACKr  4 года назад

      Cobalt2 is the theme

    • @p3ace445
      @p3ace445 4 года назад

      @@codeSTACKr whats that cursor effect. can you please tell?

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

    The video is good. I would like to encourage you to explain it more. Thank You

  • @hernan869
    @hernan869 4 года назад

    Great video! but i got a question, how can I handle multiple type of users? I mean, like an admin and so on...

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

    Thank you for your time, amazing tutorial!

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

    Hi, can we have a sso with this auth0?