I'm thinking about a rewrite of a existing application. This legacy application does not separate frontend and backend. It's a single application with server side rendering.
I want to rewrite it to a separate backend that provides a restful API and a frontend. Right now I plan to use Node.js with Express and tsoa as backend and SvelteKit as frontend. I don't think the actual technology used to implement the application matters, but I wanted to mention it just in case; the only requirement is to separate the frontend from the backend.
Users log in to the legacy app with Google as the authorization server. This will have to stay this way.
How to authenticate the user in the backend? Ideas/questions I have had so far:
- Can OAuth provide something like a JWT so that my backend can confirm that the user is logged in?
- Do I need to implement a JWT mechanism myself between frontend and backend? And if it is suggested: How can the backend be sure that the request for a JWT is legitimate?
- Should the backend provide the login?
- Am I misunderstanding the problem?