Tuesday 24 November 2015

Invalid grant when using Token Refresh

We have had a couple cases where the account is over a year old so that could be a reason for those. However, we had an account yesterday made and today we go to refresh and it failed with invalid grant. I checked  https://myaccount.google.com/ -> Connected apps & sites -> Manage apps and it says we have access to there Google Adwords and we are allowed to manage there adwords campaigns with authorization date of Yesterday, 1:36 PM. As far as I can tell none of the accounts that we have fixed by re-authorizing have had any problems.

On Friday, November 20, 2015 at 2:29:20 PM UTC-5, Josh Radcliff (AdWords API Team) wrote:
Hi,

Is it possible that you are seeing a large # of invalidated refresh tokens because they have not been used for 6 months?

If that does not explain the invalid grant errors:

1. Could you let me know if this error has occurred again on any accounts where you generated a new refresh token?

2. Once you get an invalid grant error for a given account, are you able to check the status of the grant via https://myaccount.google.com/ -> Connected apps & sites -> Manage apps? I'd be curious to know what you see there in this case. Below is what that page will look like for an account that has granted access to a project named My AdWords Web Project.



Thanks,
Josh, AdWords API Team

On Friday, November 20, 2015 at 11:08:38 AM UTC-5, jnewm...@gmail.com wrote:
Well that certainly can't be the problem because we don't get new refresh tokens except when we oauth an account. Our process goes as follows: Oauth an account which gives us an access and refresh token. We use the access token till it expires and then use the refresh token to acquire a new access token. If the account starts to show "invalid grant" we oauth again and get a new access and refresh token. This is vicious cycle is causing our app to break for many clients when "invalid grant" occurs.

On Tuesday, November 17, 2015 at 4:48:16 PM UTC-5, Umesh Dengale wrote:
Hello,

There is currently a limit of 25 refresh tokens per user account per client. Please check out token expiration section from the Using OAuth 2.0 to Access Google APIs guide for more details.

Regards,
Umesh, AdWords API Team.
 

No comments:

Post a Comment