We are seeing the error below on our production server when users log in (no issues on stage server). It is intermittent, but appears to be more common in Chrome/Safari.
For sessions, we are using express-session
as follows:
const sessionConfig = {
secret: "[secret]",
resave: false,
saveUninitialized: false,
cookie: {
sameSite: "none",
secure: true
}
};
app.use(session(sessionConfig));
app.use(oidc.router);
We’ve tried a variety of updates shown in the forums on Github, but nothing has worked so far. Any help would be greatly appreciated:
Error: did not find expected authorization request details in session, req.session["oidc:https://wpp.okta.com"] is undefined
at /usr/src/app/node_modules/openid-client/lib/passport_strategy.js:126:13
at OpenIDConnectStrategy.authenticate (/usr/src/app/node_modules/openid-client/lib/passport_strategy.js:174:5)
at attempt (/usr/src/app/node_modules/passport/lib/middleware/authenticate.js:366:16)
at authenticate (/usr/src/app/node_modules/passport/lib/middleware/authenticate.js:367:7)
at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/usr/src/app/node_modules/express/lib/router/index.js:317:13)
at /usr/src/app/node_modules/express/lib/router/index.js:284:7
at Function.process_params (/usr/src/app/node_modules/express/lib/router/index.js:335:12)
at next (/usr/src/app/node_modules/express/lib/router/index.js:275:10)
at SessionStrategy.strategy.pass (/usr/src/app/node_modules/passport/lib/middleware/authenticate.js:343:9)