From the course: Building React and ASP.NET Core Applications

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Setting up authentication in React

Setting up authentication in React

From the course: Building React and ASP.NET Core Applications

Start my 1-month free trial

Setting up authentication in React

- Now that we set up the application in the auth0, let us go to the React app and set up the authentication in there, as well. So for that, let's go to Visual Code. The first thing that we need to do in here is that we need to install a package. So let us right-click on ClientApp, then Open in terminal. Let's clear the terminal. And then, let's go to the official documentation one more time. So now we see that we need to install the auth0/auth0-spa-js. Now we have this other package in here, as well, but we don't need that package because we already have an application and we don't need to set up the routing package. So we still have the #auth0/auth0-spa-js is the Auth0's JavaScript SDK for Single Page Applications. So we are building a React app and this is our case. Let us copy the auth command. Go back to our app and paste it in here. Now let us remove the React router. Done. And then add at the end "--save." (mumbles) So…

Contents