Developing a Secure API with NestJS

Thanks Dan!

On the Angular side, configuring auth0-angular for SSR was the biggest pain point, since I needed to implement a mock service for running on server-side and wrap the client. This issue provided the info needed to get it working. On the Nest side, configuring the Auth0 strategy correctly is my current sticking point, and there’s very little information to work from when debugging. Although I’m now able to authenticate on the client side (which didn’t work until I set up an https reverse proxy, enabled helmet in Nest, and set token endpoint authentication method to None in Auth0 config), authorization isn’t working yet- I still get 401 on endpoints protected with my Auth0 AuthGuard, despite having authenticated on the client side successfully. I assume there’s some mismatch between the client and server config causing that, as the Auth0 strategy in Nest is set up the same as in your tutorial here. A full-stack example would be really helpful!

1 Like