API Authentication with Node - Part #9 - OAuth Explained

Description 💻

In the ninth part of API authentication with Node series, we'll learn about OAuth (OAuth2). The OAuth flow can be tricky, especially when trying to understand it for the first time.

The fact that doesn't help it is that there are two different ways of handling OAuth.

First way - you use OAuth in server-side rendered application in which your backend code will pretty much handle everything.

Second way - (the one that we're going for) is the case of single page application (SPA) in which we have separate frontend and backend servers.

In this approach, OAuth is going to be pretty much split into two pieces. One piece will be handled on the frontend, while the other piece will be handled on the backend.

The frontend will need to get access to accessToken, while the backend will actually exchange accessToken for user profile and take care of things from there.

In case you're looking to learn Node, Express, MongoDB, React, client-side validation, server-side validation and more this series should be interesting to you.

Video 🎥

Want to support CodeWorkr? 💖 🌍

To be clear - I'm creating these posts/videos because I enjoy it and I like helping others when I can without expecting anything in return, however, in case you like these posts and I mean you've got to really, really like them to read this section - and would like to support me, first of all, that'd be amazing - thank you very much, secondly, these are some of the ways you can help:

  • Upvote this post
  • Send STEEM to @codeworkr
  • Follow CodeWorkr on Steemit
  • Subscribe to CodeWorkr on Youtube
  • Follow CodeWorkr on Twitter
  • Like CodeWorkr on Facebook
  • BTC 1PAtL34zjj8hKfVziZVe5Yz6HCH7G2iYyx
H2
H3
H4
3 columns
2 columns
1 column
Join the conversation now