Getting 401 error while calling spring-boot api from angular app

I had to install node-sass v4 to get the frontend to startup.

npm i node-sass@4

After doing this, I was able to login just fine. Changes I made:

  1. In app.module.ts, I added my Okta settings and changed the redirect URI to window.location.origin + '/callback'. I also removed OktaAuthGuard from the providers list.
  2. In app-routing.module.ts, I changed the users route to callback. { path: 'callback', component: OktaCallbackComponent }
  3. Now, when I navigate to http://localhost:4200/home, it says “user-details works!” and returns data from the backend in my console.