Hello,
I have implemented the universal login system in an Angular SPA and everything works correctly.
I have created a backend with NestJS to consume certain data from a database and I want the requests to be protected by Auth0.
Could someone guide me on what steps I can follow to dig into the documentation? I think these would be:
- Login from the Angular SPA.
- Once authenticated, when the auth token is received from Auth0 and this is saved in localstorage of the browser, make a request to my backend type to send this token and persist it in the database.
- From there, in each Angular request to the backend, send the auth token provided by Auth0 (through HttpInterceptor) in the headers and the backend checks if the token matches the one stored in the database.
- If so, process the request. If not, deny it.
- If denied, Angular must perform the deauthentication process in Auth0.
This is basically the idea. Am I on the right track? Any other ideas or suggestions?
Thanks