I managed to successfully complete the OAuth flow and gain access token for the user. The OAuth is on a separate server & identity provider (OpenID Connect).
Now, I need to add middleware to check that the user is authenticated throughout his session in the application.
Any idea/directions on how I can manage this? Quite lost.
Seems like Pathfix does exactly what you are looking for. It is a Serverless OAuth Middleware, If you want to try it out. Might save you a whole lot of time setting up and deploying a middleware.
Disclaimer: I am part of the Pathfix Team :)