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

Problem with Google & Facebook auth on nginx load balanced node.js #435

Open
smanuel opened this issue Jul 12, 2013 · 1 comment
Open

Problem with Google & Facebook auth on nginx load balanced node.js #435

smanuel opened this issue Jul 12, 2013 · 1 comment
Labels

Comments

@smanuel
Copy link

smanuel commented Jul 12, 2013

Hello,
It looks like everyauth is relying on some state which is not stored in the session store and thus I can't make it work in an environment where nginx is load balancing several node.js instances.
I'm using connect-redis as a session store.
Here're the steps to reproduce (without the complexity of running it behind nginx):

  1. I start the server (e.g. node server.js)
  2. I navigate to my page with the authentication options (e.g. /home)
  3. I navigate to the google authentication option (e.g. /auth/google)
  4. When the google login page shows (I've logged out from google in advance) I restart my node server
  5. When I login into google I'm redirected to "/auth/google/callback?code=....." but the everyauth code stops somewhere after "starting step - getAccessToken" and the page timeouts.

Any help on the matter will be highly appreciated.

Thanks!

P.S. Just wanted to add that this issue is reproducible both with Google and Facebook but Yahoo seems to work fine (at least it worked when I tested it once. maybe I have to try again).

@JasonGiedymin
Copy link

Just to chime in, you might want to do simple round robin balancing via hash/mod. This way you know some user u will always be diverted to the same box b. Not completely stateless when all is said and done, but it works. Nginx has the capability via conf file or plug-in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants