jaredhanson / passport-google-oauth

Google authentication strategies for Passport and Node.js.
https://www.passportjs.org/packages/passport-google-oauth/?utm_source=github&utm_medium=referral&utm_campaign=passport-google-oauth&utm_content=about
MIT License
776 stars 327 forks source link

How to handle : 403 : userRateLimitExceeded #75

Open devasur opened 9 years ago

devasur commented 9 years ago

Getting this on my production server randomly for some users.

What is the right strategy to handle this error? If I were to retry where should I insert the retry routine? I have Google+ APIs enabled. It works fine in most cases. But I think under load there is a chance of getting this error.

Express
500 InternalOAuthError: failed to fetch user profile (status: 403 data: {
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "userRateLimitExceeded",
"message": "User Rate Limit Exceeded"
}
],
"code": 403,
"message": "User Rate Limit Exceeded"
}
}
) "error": { "errors": [ { "domain": "usageLimits", "reason": "userRateLimitExceeded", "message": "User Rate Limit Exceeded" } ], "code": 403, "message": "User Rate Limit Exceeded" } } ) at /node_modules/passport-google-oauth/lib/passport-google-oauth/oauth2.js:88:28 at passBackControl (/node_modules/passport-google-oauth/node_modules/passport-oauth/node_modules/passport-oauth2/node_modules/oauth/lib/oauth2.js:124:9) at IncomingMessage.(/node_modules/passport-google-oauth/node_modules/passport-oauth/node_modules/passport-oauth2/node_modules/oauth/lib/oauth2.js:143:7) at IncomingMessage.emit (events.js:117:20) at _stream_readable.js:944:16 at process._tickCallback (node.js:442:13)
devasur commented 9 years ago

Awesome! nothing? @jaredhanson , please?

simnare commented 9 years ago

As error clearly suggest - you have reached your requests limit. At the moment of writing these limits for free accounts are: Free quota - 20,000,000 requests/day Per-user limit - 5 requests/second/user

ar5had commented 7 years ago

@simnare I also get the same error but I am very sure I haven't crossed the free quota.