jaredhanson / passport-google

Google (OpenID) authentication strategy for Passport and Node.js.
MIT License
149 stars 80 forks source link

Google SSO with passport-google very slow on production server #15

Open louischatriot opened 11 years ago

louischatriot commented 11 years ago

Hey Jared,

I updated issue #14 but couldn't reopen it so I'm not sure you saw it. In short, throttling doesn't have an impact on the speed of signin. Even on my dev machine, it still takes about twice as much as what I saw on other websites.

To be clearer, here are the two places that take a lot of time. Both are in file passport-google/node_modules/passport-openid/lib/passport-openid/trategy.js, in the function defined by Strategy.prototype.authenticate (in my version its line 123). Here is what happens:

1) This function is called immediately upon click on the login button, and executes the else of the big if clause. It immediately arrives at this._relyingParty.authenticate (line 195 for me) which takes about 3s to call its callback 2) The call back calls my return url which in turns calls this function again, immediately. This time we are the big if condition is satisfied. 3) this._relyingParty.verifyAssertion is immediately called (line 144 for me) but takes a further 1.2s to call its callback. 4) Once the callback is called, the rest of the process is instantaneous (~10ms).

So I am interested in understanding what this._relyingParty.authenticate and this._relyingParty.verifyAssertion do that can take so much time.

Thanks again, Louis

nicholsonjf commented 6 years ago

I'm having this same issue. Frustrating that there was never any response to this. Did you ever find any solution to this problem?

mahdipakravan-dev commented 4 years ago

And Also i searching for a response... Nothing...