oauth problem

45 views
Skip to first unread message

László Várkondi

unread,
Nov 16, 2016, 9:39:04 AM11/16/16
to AdWords API Forum
[16-Nov-2016 13:47:03 Europe/Budapest] PHP Fatal error:  Uncaught exception 'OAuth2Exception' with message '{
 "error": "invalid_grant",
 "error_description": "Bad Request"
}
' in /home/............./vendor/googleads/googleads-php-lib/src/Google/Api/Ads/Common/Util/SimpleOAuth2Handler.php:118
Stack trace:
#0 /home/............./vendor/googleads/googleads-php-lib/src/Google/Api/Ads/Common/Util/SimpleOAuth2Handler.php(92): SimpleOAuth2Handler->MakeRequest('https://www.goo...', Array)
#1 /home/............./vendor/googleads/googleads-php-lib/src/Google/Api/Ads/Common/Util/OAuth2Handler.php(107): SimpleOAuth2Handler->RefreshAccessToken(Array)
#2 /home/............./vendor/googleads/googleads-php-lib/src/Google/Api/Ads/Common/Lib/AdsSoapClient.php(452): OAuth2Handler->GetOrRefreshAccessToken(Array)
#3 /home/............./vendor/googleads/googleads-php-lib/src/Google/Api/Ads/Common/Lib/AdsSoapClient.php(199): AdsSoapClient->GenerateHttpHe in /home/............./vendor/googleads/googleads-php-lib/src/Google/Api/Ads/Common/Util/SimpleOAuth2Handler.php on line 118

Thank you in advance,

László

Vishal Vinayak (Adwords API Team)

unread,
Nov 16, 2016, 2:43:34 PM11/16/16
to AdWords API Forum
Hi László,

You may see the invalid_grant error if your refresh token has expired, revoked or deemed invalid. I would recommend regenerating your refresh token by following the instructions for your PHP client library here.

Regards,
Vishal, AdWords API Team
Reply all
Reply to author
Forward
0 new messages