'Google Oauth token limits
I've done a lot of reading but can't seem to nail this one down. So I understand that Google sets a limit of 50 refresh tokens in an active environment. But is there a daily or topline limit on how many times you can request access tokens? I ask because if there is no limit, then it stands to reason that a new access token should be obtained every time you want to send an email (or a batch of emails) as opposed to only obtaining one only if the token is older than 3600 seconds. This would simplify coding but perhaps Google would frown on this.
Any thoughts would be appreciated. Thanks!
Solution 1:[1]
So I understand that Google sets a limit of 50 refresh tokens in an active environment.
Google sets a limit of 50 outstanding refresh tokens for a single user within your client.
If I consent to your application accessing my data you get a refresh token back, If i do it again you get another refresh token back. This can continue for up to 50 refresh tokens and they will all work. If i do it again the first one will be revoked and i will again have 50 outstanding refresh tokens.
Remember this is user based. each user can have up to 50 outstanding refresh tokens associated with your app.
There is no limit to the number of users for your app unless you are still in the testing phase and in that case you can have 100 test users. This is imposed by the google developer console.
But is there a daily or topline limit on how many times you can request access tokens?
There is no limit to the use of a refresh token.
Yes you can just request a new access token when ever you need one. Just remember that every time you request one you are putting a HTTP request load on your system. If you are requesting one ever minute that's 55 http requests you are sending that you technically don't need to be sending. Also remember that the user now has 55 outstanding access tokens that will continue to work. You could be potentially leaking access with this.
But no google wont stop you. I have also done it before.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | DaImTo |
