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

Strategies does not scale well #613

Open
JSteunou opened this issue Oct 6, 2017 · 0 comments
Open

Strategies does not scale well #613

JSteunou opened this issue Oct 6, 2017 · 0 comments

Comments

@JSteunou
Copy link

JSteunou commented Oct 6, 2017

In case of multiple node services, scaled horizontally, passport use (which register a Strategy by name) and authenticate (which get back a Strategy previously registered by name) do not scale well because all the nodes would not shared the same private _strategies store object.

You can have one request initiated on a node but ended on another node for the sso callback when having load balancing and those can have different Strategy configuration for the same name. This can happen when you update your Strategies configuration but restart your node one by one for a high quality of service.

A better way to handle this is to recreate the Strategy for each request and never rely on a store object (so no cache), but the authenticate method get in the way because it only rely on the _strategies internal store See https://github.com/jaredhanson/passport/blob/master/lib/authenticator.js#L463

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

No branches or pull requests

1 participant