OAuth - adriana-401-advanced-javascript/seattle-javascript-401n13 GitHub Wiki

To build an oauth app you must have the following:

  • Server
  • .env file with:
    • MONGODB_URI
    • PORT
    • SECRET
    • GOOGLE_API_KEY
    • GOOGLE_CLIENT_SECRET

Backend server

create an account/app/credential on your assigned OAuth Provider configure oauth credentials to support a client app on http://localhost configure oauth credentials to support a server redirect uri to http://localhost:3000/oauth create a backend route GET /oauth for handling oauth redirects create a new file under /src/auth/oauth for your provider

Frontend server

create an index.html with an anchor tag pointing to the google authorization page configure the query string with correct key value pairs

https://developer.github.com/apps/building-oauth-apps/authorizing-oauth-apps/ https://developer.okta.com/blog/2018/08/21/build-secure-rest-api-with-node https://aaronparecki.com/oauth-2-simplified/