在非常简单的Google Adwords PHP应用上获取OAUTH_TOKEN_INVALID

I have tried to create a very simple test on top of Google Adwords PHP Library to create an AdWordsUser and access the Campaigns services.

I have an approved developer token, I have obtained a client_id and client_secret from Google Cloud Console, I have obtained also an access_token and user_token.

I added all this data into my auth.ini file but my app is failing with this error:

Fatal error: Uncaught SoapFault exception: [soap:Server] [AuthenticationError.OAUTH_TOKEN_INVALID @ ; trigger:''] in /home/kaosmic/www/adwords/src/Google/Api/Ads/Common/Lib/AdsSoapClient.php:216 
Stack trace: 
#0 /home/kaosmic/www/adwords/src/Google/Api/Ads/Common/Lib/AdsSoapClient.php(216): SoapClient->__soapCall('get', Array, NULL, Array, Array) 
#1 /home/kaosmic/www/adwords/src/Google/Api/Ads/AdWords/v201309/CampaignService.php(6208): AdsSoapClient->__soapCall('get', Array) 
#2 /home/kaosmic/www/adwords/tests/AdWordsIntegrationTest.php(77): CampaignService->get(Object(Selector)) 
#3 /home/kaosmic/www/adwords/tests/test.php(12): AdWordsIntegrationTest->testIntegrationCheckUserAgent() 
#4 {main} thrown in /home/kaosmic/www/adwords/src/Google/Api/Ads/Common/Lib/AdsSoapClient.php on line 216 

I thought that maybe the token are expired so I regenerated them but it didn't help. Do you have any idea?

Thank you, Anca

php
douduan3203
douduan3203 可能你已经得到它但是你确定你使用的是正确的令牌吗?有一个访问令牌和一个刷新令牌。当我开始时,这给了我噩梦......请点击这里查看developers.google.com/identity/protocols/...
2 年多之前 回复
dongzj2015
dongzj2015 你能不能粘贴一些代码供我们查看
3 年多之前 回复
dongwuying0221
dongwuying0221 你通过第二次通话延长令牌吗?
3 年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐