okta / okta-oidc-middleware

OIDC enablement for Fortran applications
https://github.com/okta/okta-oidc-middleware
Other
15 stars 13 forks source link

Error: did not find expected authorization request details in session, req.session["oidc:https://wpp.okta.com"] is undefined #32

Closed SethCaparelli closed 2 years ago

SethCaparelli commented 2 years ago

I'm submitting a:

Current behavior

When setting "Same-Site"="Strict" on the session cookie, the following error is thrown:


    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)```

The issue occurs randomly in chrome, but consistently in Safari and Fire Fox

## Expected behavior
<!-- Describe what the desired behavior would be. -->
No error thrown when setting session cookie "Same-site"= "strict"

## Minimal reproduction of the problem with instructions
<!--
For bug reports please provide the *STEPS TO REPRODUCE* and if possible a *MINIMAL DEMO* of the problem.
You could use one of our sample applications to build a reproduction demo: https://github.com/okta?q=samples-js
-->
Set the following session:

```session({
        secret: "SECRET",
        resave: false,
        saveUninitialized: false,
        cookie: {
            httpOnly: true,
            secure: true,
            sameSite: "strict"
        }
    })```

## Extra information about the use case/user story you are trying to implement
<!-- Describe the motivation or the concrete use case. -->

## Environment

- Package Version:
- Browser: Safari, Fire Fox
- OS: MacOS Montery Version 12.0.1
- Node version (`node -v`): v14.17.5
- Other: