Hey everyone. I am running an external nodejs backend and a react FE.
In my backend i am doing router.use(oktaAuth.router);
and im setting up the oktaAuth using new ExpressOIDC
from @okta/oidc-middleware
.
I have a protected route by using oktaAuth.ensureAuthenticated()
.
My flow is when user logs in, FE redirects user to the backend route http://localhost:3030/login
- I login to Okta
- Login succeeds
- After login succeeds the okta auth flow redirects to the backend base route
from there I have this line of code to redirect to the FE right away
router.get(‘/’, (req, res) => {
res.redirect(process.env.FRONTEND_BASE_URL);
});
I can see that there is a connect.sid= stored but I believe this is in the backend? How can i make an authenticated call to the. backend, do I have to use the bearer token or what? Am i doing this all wrong? Or am i on the right path? Thanks