Authentication is the process of giving access to the resources of your application to select individuals. You can authenticate users in two different ways: by using cookies or by using tokens, which we can store in either the localStorage or sessionStore of the browser. In this chapter, we will be using OAuth (pronounced as, oh Auth) using a third-party service called Auth0 (Auth zero). Using OAuth, the application is not exposed to passwords since the authentication happens in a different application altogether.
Let's look at how authentication occurs using OAuth. This is explained in the following diagram:
You need to follow these steps to authenticate the user:
- In our web app, we will have a Log In/Sign In button in our application. The routes will be hidden and guarded based on whether the browser has the Auth...