ferroleader.blogg.se

React router dom auth
React router dom auth











react router dom auth
  1. #React router dom auth install#
  2. #React router dom auth manual#

#React router dom auth install#

  • Install Google’s API library, initialize it with the OAuth Client ID.
  • Very easy to set up thanks to Googles JS lib to automate flow.
  • Usually used when we have an app that only needs to access user data while they are logged in.
  • Results in a token that a browser app can use to make requests on behalf of the user.
  • Difficult to setup because we need to store a lot of info about the user.
  • Usually used when we have an app that needs to access user data when they are not logged in.
  • Results in a token that a server can use to make requests on behalf of the user.
  • There are two basic types of OAuth, Server and Browser.
  • Our app making actions on behalf of the user.
  • We are trusting the outside provider to correctly handle identification of a user.
  • Outside provider tells us about the user.
  • User authorizes our app to access their information.
  • User authenticates with outside service provider (Google, LinkedIn, Facebook, Apple).
  • A user is logged in when the enter the correct email/password.
  • When the user tries to login, we compare email/password with what’s stored in the DB.
  • We store a record in a database with the user’s email and password.
  • Here are some quick notes on the differences between a standard email/password authentication and OAuth Authentication Email/Password Authentication

    react router dom auth react router dom auth

    This is an introduction to user authentication in React using Google OAuth. Now let’s cover the process of letting someone else handle our user authentication.

    #React router dom auth manual#

    We have previously covered the process of a manual user authentication process using Passport JS and Express.













    React router dom auth