Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[oidc-middleware] It should be possible to use multiple instances of ExpressOIDC #18

Open
2 of 9 tasks
heidemn opened this issue Jul 19, 2019 · 4 comments · May be fixed by okta/okta-oidc-js#498
Open
2 of 9 tasks

Comments

@heidemn
Copy link

heidemn commented Jul 19, 2019

I'm submitting this issue for the package(s):

I'm submitting a:

  • Bug report
  • Feature request (pull request will follow...)
  • Other (Describe below)

Current behavior

Currently, it is not possible to use multiple instances of ExpressOIDC in one and the same Node.js app.

Expected behavior

It should be possible. This is e.g. useful together with the "vhost" package.

Minimal reproduction of the problem with instructions

  • Create 2 or more Express vhost apps using the "vhost" npm package:
  • Create an Express main app
  • It is only possible to log in with Okta at one of the vhosts. For other vhosts, you get a state mismatch.
const app1 = express();
const oidc1 = new ExpressOIDC(oidcConfig1);
app1.use(require('express-session')(...));
app1.use(oidc1.router);

const app2 = express();
// ...similar to app1...

const mainApp = express();
mainApp.use(vhost("*.app1.com", app1));
mainApp.use(vhost("*.app2.com", app2));

Extra information about the use case/user story you are trying to implement

Environment

  • Package Version: 2.0.0
  • Browser: Chrome
  • OS: Browser: Win10 / Server: Ubuntu 18.04
  • Node version (node -v): v10.15.1
  • Other:
heidemn referenced this issue in heidemn/okta-oidc-js Jul 19, 2019
…xist

The previous use of a static Passport instance prevented the parallel
use of multiple ExpressOIDC instances. Adding the Passport instance to
the context makes this possible.

Resolves: #497
@rcollette
Copy link

I've run into this. It seems like the PR provided some guidance that should work for this. I need to implement a white labeled site, serving under multiple host names and this is a real blocker.

I'm hoping that perhaps the sign-in-widget with PKCE might be a way around this.

@swiftone
Copy link

swiftone commented Apr 3, 2020

@rcollette - I cannot promise any movement on this problem, but if you have any details you can share about the general use case, that could be informative.

Would a user be consistently served by the same express instance during their session (so there is no need to share the token among the servers)?

@rcollette
Copy link

There can definitely be multiple express instances, either on load balanced servers or multiple forked processes on the same machine. But since Session, and in my case backed by MongoDb, is used for the OIDC middleware, I'm not sure why multiple instances would be a concern.

The use case is that we have a site, having multiple domain names, where the look and feel (chrome) of the site is unique for each domain. This means that a callback on any given instance, must allow the use of multiple trusted host names. A user session would consistently use one host name. If I log on or sign on at a.com then the callback would go to a.com

@swiftone
Copy link

Internal ref: OKTA-291513

@denysoblohin-okta denysoblohin-okta transferred this issue from okta/okta-oidc-js Oct 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants